mirror of https://github.com/databricks/cli.git
Only run "bind schema" acceptance test if test stage has Unity Catalog enabled
This commit is contained in:
parent
a02dcfdbde
commit
bcc5d6b985
|
@ -225,6 +225,15 @@ func runTest(t *testing.T, dir, coverDir string, repls testdiff.ReplacementsCont
|
||||||
t.Skipf("Disabled via Cloud setting in %s (CLOUD_ENV=%s)", configPath, cloudEnv)
|
t.Skipf("Disabled via Cloud setting in %s (CLOUD_ENV=%s)", configPath, cloudEnv)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if config.RequiresStageFeature(UnityCatalogEnabledWorkspace) {
|
||||||
|
if os.Getenv("TEST_METASTORE_ID") == "" {
|
||||||
|
t.Skipf("Skipping on non-UC workspaces")
|
||||||
|
}
|
||||||
|
if os.Getenv("DATABRICKS_ACCOUNT_ID") != "" {
|
||||||
|
t.Skipf("Skipping on accounts")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var tmpDir string
|
var tmpDir string
|
||||||
var err error
|
var err error
|
||||||
if KeepTmp {
|
if KeepTmp {
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
|
Local = false
|
||||||
Cloud = true
|
Cloud = true
|
||||||
Local = false
|
RequiredStageFeatures=["unity-catalog"]
|
||||||
|
|
|
@ -17,6 +17,12 @@ import (
|
||||||
|
|
||||||
const configFilename = "test.toml"
|
const configFilename = "test.toml"
|
||||||
|
|
||||||
|
type StageFeature string
|
||||||
|
|
||||||
|
const (
|
||||||
|
UnityCatalogEnabledWorkspace StageFeature = "unity-catalog"
|
||||||
|
)
|
||||||
|
|
||||||
type TestConfig struct {
|
type TestConfig struct {
|
||||||
// Place to describe what's wrong with this test. Does not affect how the test is run.
|
// Place to describe what's wrong with this test. Does not affect how the test is run.
|
||||||
Badness *string
|
Badness *string
|
||||||
|
@ -31,6 +37,10 @@ type TestConfig struct {
|
||||||
// If true, run this test when running with cloud env configured
|
// If true, run this test when running with cloud env configured
|
||||||
Cloud *bool
|
Cloud *bool
|
||||||
|
|
||||||
|
// Which stage features this test requires. Each string is a feature name that must be present
|
||||||
|
// in the current stage for the test to run. If absent, no specific features are required.
|
||||||
|
RequiredStageFeatures []StageFeature
|
||||||
|
|
||||||
// List of additional replacements to apply on this test.
|
// List of additional replacements to apply on this test.
|
||||||
// Old is a regexp, New is a replacement expression.
|
// Old is a regexp, New is a replacement expression.
|
||||||
Repls []testdiff.Replacement
|
Repls []testdiff.Replacement
|
||||||
|
@ -59,6 +69,15 @@ type TestConfig struct {
|
||||||
CompiledIgnoreObject *ignore.GitIgnore
|
CompiledIgnoreObject *ignore.GitIgnore
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (tc *TestConfig) RequiresStageFeature(feature StageFeature) bool {
|
||||||
|
for _, f := range tc.RequiredStageFeatures {
|
||||||
|
if f == feature {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
type ServerStub struct {
|
type ServerStub struct {
|
||||||
// The HTTP method and path to match. Examples:
|
// The HTTP method and path to match. Examples:
|
||||||
// 1. /api/2.0/clusters/list (matches all methods)
|
// 1. /api/2.0/clusters/list (matches all methods)
|
||||||
|
|
Loading…
Reference in New Issue