mirror of https://github.com/databricks/cli.git
refactor: use RequiresUnityCatalog boolean field instead of RequiresStageFeature()
This commit is contained in:
parent
faf387753d
commit
0f16296168
|
@ -223,10 +223,8 @@ func runTest(t *testing.T, dir, coverDir string, repls testdiff.ReplacementsCont
|
|||
|
||||
if !isTruePtr(config.Cloud) && cloudEnv != "" {
|
||||
t.Skipf("Disabled via Cloud setting in %s (CLOUD_ENV=%s)", configPath, cloudEnv)
|
||||
}
|
||||
|
||||
if config.RequiresStageFeature(UnityCatalogEnabledWorkspace) {
|
||||
if os.Getenv("TEST_METASTORE_ID") == "" {
|
||||
} else {
|
||||
if isTruePtr(config.RequiresUnityCatalog) && os.Getenv("TEST_METASTORE_ID") == "" {
|
||||
t.Skipf("Skipping on non-UC workspaces")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
Local = false
|
||||
Cloud = true
|
||||
RequiredStageFeatures=["unity-catalog"]
|
||||
RequiresUnityCatalog = true
|
||||
|
|
|
@ -37,9 +37,8 @@ type TestConfig struct {
|
|||
// If true, run this test when running with cloud env configured
|
||||
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
|
||||
// If true and Cloud=true, run this test only if unity catalog is available in the cloud environment
|
||||
RequiresUnityCatalog *bool
|
||||
|
||||
// List of additional replacements to apply on this test.
|
||||
// Old is a regexp, New is a replacement expression.
|
||||
|
@ -69,15 +68,6 @@ type TestConfig struct {
|
|||
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 {
|
||||
// The HTTP method and path to match. Examples:
|
||||
// 1. /api/2.0/clusters/list (matches all methods)
|
||||
|
|
Loading…
Reference in New Issue