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 (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"path/filepath"
|
"path"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
@ -34,7 +34,7 @@ func TestAccApiPost(t *testing.T) {
|
||||||
t.Skip("DBFS REST API is disabled on gcp")
|
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(`{
|
requestPath := writeFile(t, "body.json", fmt.Sprintf(`{
|
||||||
"path": "%s"
|
"path": "%s"
|
||||||
}`, dbfsPath))
|
}`, dbfsPath))
|
||||||
|
|
|
@ -5,9 +5,6 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"os"
|
|
||||||
"os/exec"
|
|
||||||
"path/filepath"
|
|
||||||
"sync"
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
@ -43,25 +40,11 @@ func createRemoteTestProject(t *testing.T, projectNamePrefix string, wsc *databr
|
||||||
return remoteProjectRoot
|
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) {
|
func TestAccLock(t *testing.T) {
|
||||||
t.Log(GetEnvOrSkipTest(t, "CLOUD_ENV"))
|
t.Log(GetEnvOrSkipTest(t, "CLOUD_ENV"))
|
||||||
ctx := context.TODO()
|
ctx := context.TODO()
|
||||||
wsc := databricks.Must(databricks.NewWorkspaceClient())
|
wsc, err := databricks.NewWorkspaceClient()
|
||||||
createLocalTestProject(t)
|
require.NoError(t, err)
|
||||||
remoteProjectRoot := createRemoteTestProject(t, "lock-acc-", wsc)
|
remoteProjectRoot := createRemoteTestProject(t, "lock-acc-", wsc)
|
||||||
|
|
||||||
// 50 lockers try to acquire a lock at the same time
|
// 50 lockers try to acquire a lock at the same time
|
||||||
|
|
Loading…
Reference in New Issue