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.
|
// Directory path within a Git repository containing the template.
|
||||||
TemplateDir string
|
TemplateDir string
|
||||||
|
|
||||||
|
// Git tag or branch to download the template from. Only one of these can be
|
||||||
|
// specified.
|
||||||
Tag string
|
Tag string
|
||||||
Branch string
|
Branch string
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package template
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"runtime"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/databricks/cli/cmd/root"
|
"github.com/databricks/cli/cmd/root"
|
||||||
|
@ -15,24 +16,31 @@ import (
|
||||||
|
|
||||||
func TestDefaultWriterConfigure(t *testing.T) {
|
func TestDefaultWriterConfigure(t *testing.T) {
|
||||||
// Test on local file system.
|
// Test on local file system.
|
||||||
w1 := &defaultWriter{}
|
w := &defaultWriter{}
|
||||||
err := w1.Configure(context.Background(), "/foo/bar", "/out/abc")
|
err := w.Configure(context.Background(), "/foo/bar", "/out/abc")
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
assert.Equal(t, "/foo/bar", w1.configPath)
|
assert.Equal(t, "/foo/bar", w.configPath)
|
||||||
assert.IsType(t, &filer.LocalClient{}, w1.outputFiler)
|
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 := dbr.MockRuntime(context.Background(), true)
|
||||||
ctx = root.SetWorkspaceClient(ctx, &databricks.WorkspaceClient{
|
ctx = root.SetWorkspaceClient(ctx, &databricks.WorkspaceClient{
|
||||||
Config: &workspaceConfig.Config{Host: "https://myhost.com"},
|
Config: &workspaceConfig.Config{Host: "https://myhost.com"},
|
||||||
})
|
})
|
||||||
w2 := &defaultWriter{}
|
w := &defaultWriter{}
|
||||||
err = w2.Configure(ctx, "/foo/bar", "/Workspace/out/abc")
|
err := w.Configure(ctx, "/foo/bar", "/Workspace/out/abc")
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
assert.Equal(t, "/foo/bar", w2.configPath)
|
assert.Equal(t, "/foo/bar", w.configPath)
|
||||||
assert.IsType(t, &filer.WorkspaceFilesExtensionsClient{}, w2.outputFiler)
|
assert.IsType(t, &filer.WorkspaceFilesExtensionsClient{}, w.outputFiler)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestMaterializeForNonTemplateDirectory(t *testing.T) {
|
func TestMaterializeForNonTemplateDirectory(t *testing.T) {
|
||||||
|
|
Loading…
Reference in New Issue