Skip to content

Commit

Permalink
fix: Use OS-aware path joiner
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyakuz-db committed Dec 17, 2024
1 parent 0037671 commit 7d8ae48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
8 changes: 4 additions & 4 deletions bundle/internal/schema/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"log"
"os"
"path"
"path/filepath"
"reflect"

"github.com/databricks/cli/bundle/config"
Expand Down Expand Up @@ -129,9 +129,9 @@ func main() {
}

func generateSchema(workdir, outputFile string) {
annotationsPath := path.Join(workdir, "annotations.yml")
annotationsOpenApiPath := path.Join(workdir, "annotations_openapi.yml")
annotationsOpenApiOverridesPath := path.Join(workdir, "annotations_openapi_overrides.yml")
annotationsPath := filepath.Join(workdir, "annotations.yml")
annotationsOpenApiPath := filepath.Join(workdir, "annotations_openapi.yml")
annotationsOpenApiOverridesPath := filepath.Join(workdir, "annotations_openapi_overrides.yml")

// Input file, the databricks openapi spec.
inputFile := os.Getenv("DATABRICKS_OPENAPI_SPEC")
Expand Down
7 changes: 0 additions & 7 deletions bundle/internal/schema/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"os"
"path"
"reflect"
"runtime"
"testing"

"github.com/databricks/cli/bundle/config"
Expand Down Expand Up @@ -41,9 +40,6 @@ func copyFile(src, dst string) error {
// 2. replace all "PLACEHOLDER" values with the actual descriptions if possible
// 3. run `make schema` again to regenerate the schema with acutal descriptions
func TestRequiredAnnotationsForNewFields(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip()
}
workdir := t.TempDir()
annotationsPath := path.Join(workdir, "annotations.yml")
annotationsOpenApiPath := path.Join(workdir, "annotations_openapi.yml")
Expand All @@ -68,9 +64,6 @@ func TestRequiredAnnotationsForNewFields(t *testing.T) {

// Checks whether types in annotation files are still present in Config type
func TestNoDetachedAnnotations(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip()
}
files := []string{
"annotations.yml",
"annotations_openapi.yml",
Expand Down

0 comments on commit 7d8ae48

Please sign in to comment.