mirror of https://github.com/databricks/cli.git
Fix integration tests for windows (#165)
Successful run: Azure: https://github.com/databricks/eng-dev-ecosystem/actions/runs/3892131225 AWS: https://github.com/databricks/eng-dev-ecosystem/actions/runs/3892432562
This commit is contained in:
parent
bf9f0c06b0
commit
e48eb6ff50
|
@ -3,7 +3,7 @@ package internal
|
|||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"path"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
@ -34,7 +34,7 @@ func TestAccApiPost(t *testing.T) {
|
|||
t.Skip("DBFS REST API is disabled on gcp")
|
||||
}
|
||||
|
||||
dbfsPath := filepath.Join("/tmp/bricks/integration", RandomName("api-post"))
|
||||
dbfsPath := path.Join("/tmp/bricks/integration", RandomName("api-post"))
|
||||
requestPath := writeFile(t, "body.json", fmt.Sprintf(`{
|
||||
"path": "%s"
|
||||
}`, dbfsPath))
|
||||
|
|
|
@ -5,9 +5,6 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"sync"
|
||||
"testing"
|
||||
"time"
|
||||
|
@ -43,25 +40,11 @@ func createRemoteTestProject(t *testing.T, projectNamePrefix string, wsc *databr
|
|||
return remoteProjectRoot
|
||||
}
|
||||
|
||||
func createLocalTestProject(t *testing.T) string {
|
||||
tempDir := t.TempDir()
|
||||
|
||||
cmd := exec.Command("git", "clone", EmptyRepoUrl)
|
||||
cmd.Dir = tempDir
|
||||
err := cmd.Run()
|
||||
assert.NoError(t, err)
|
||||
|
||||
localProjectRoot := filepath.Join(tempDir, "empty-repo")
|
||||
err = os.Chdir(localProjectRoot)
|
||||
assert.NoError(t, err)
|
||||
return localProjectRoot
|
||||
}
|
||||
|
||||
func TestAccLock(t *testing.T) {
|
||||
t.Log(GetEnvOrSkipTest(t, "CLOUD_ENV"))
|
||||
ctx := context.TODO()
|
||||
wsc := databricks.Must(databricks.NewWorkspaceClient())
|
||||
createLocalTestProject(t)
|
||||
wsc, err := databricks.NewWorkspaceClient()
|
||||
require.NoError(t, err)
|
||||
remoteProjectRoot := createRemoteTestProject(t, "lock-acc-", wsc)
|
||||
|
||||
// 50 lockers try to acquire a lock at the same time
|
||||
|
|
Loading…
Reference in New Issue