mirror of https://github.com/databricks/cli.git
fix: Skipping in-place tests on Windows
This commit is contained in:
parent
e7165ec17a
commit
49f6bc9354
|
@ -2,6 +2,7 @@ package mutator_test
|
|||
|
||||
import (
|
||||
"context"
|
||||
"runtime"
|
||||
"testing"
|
||||
|
||||
"github.com/databricks/cli/bundle"
|
||||
|
@ -374,6 +375,10 @@ func TestApplyPresetsResourceNotDefined(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestApplyPresetsInPlaceDeployment(t *testing.T) {
|
||||
if runtime.GOOS == "windows" {
|
||||
t.Skip("this test is not applicable on Windows because in-place works only in the Databricks Workspace")
|
||||
}
|
||||
|
||||
testContext := context.Background()
|
||||
enabled := true
|
||||
disabled := false
|
||||
|
|
|
@ -3,6 +3,7 @@ package mutator
|
|||
import (
|
||||
"context"
|
||||
"reflect"
|
||||
"runtime"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
|
@ -520,20 +521,24 @@ func TestPipelinesDevelopmentDisabled(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestInPlaceDeploymentEnabled(t *testing.T) {
|
||||
b, diags := processInPlaceBundle(true)
|
||||
b, diags := processInPlaceBundle(t, true)
|
||||
require.NoError(t, diags.Error())
|
||||
assert.True(t, *b.Config.Presets.InPlaceDeployment)
|
||||
assert.Equal(t, b.Config.Workspace.FilePath, b.SyncRootPath)
|
||||
}
|
||||
|
||||
func TestInPlaceDeploymentDisabled(t *testing.T) {
|
||||
b, diags := processInPlaceBundle(false)
|
||||
b, diags := processInPlaceBundle(t, false)
|
||||
require.NoError(t, diags.Error())
|
||||
assert.False(t, *b.Config.Presets.InPlaceDeployment)
|
||||
assert.NotEqual(t, b.Config.Workspace.FilePath, b.SyncRootPath)
|
||||
}
|
||||
|
||||
func processInPlaceBundle(presetEnabled bool) (*bundle.Bundle, diag.Diagnostics) {
|
||||
func processInPlaceBundle(t *testing.T, presetEnabled bool) (*bundle.Bundle, diag.Diagnostics) {
|
||||
if runtime.GOOS == "windows" {
|
||||
t.Skip("this test is not applicable on Windows because in-place works only in the Databricks Workspace")
|
||||
}
|
||||
|
||||
b := mockBundle(config.Development)
|
||||
|
||||
workspacePath := "/Workspace/lennart@company.com/"
|
||||
|
|
Loading…
Reference in New Issue