Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
bf2fc1f
acc: Refactor starting test server in a separate file
shreyas-goenka Apr 14, 2025
4f781ab
-
shreyas-goenka Apr 14, 2025
2f5aca3
-
shreyas-goenka Apr 14, 2025
0892552
-
shreyas-goenka Apr 14, 2025
0e7806b
-
shreyas-goenka Apr 14, 2025
465d74d
-
shreyas-goenka Apr 14, 2025
714226c
-
shreyas-goenka Apr 23, 2025
875ac17
-
shreyas-goenka Apr 23, 2025
530f572
Merge remote-tracking branch 'origin' into proxy-integration
shreyas-goenka Apr 23, 2025
b8b22d4
fix lint
shreyas-goenka Apr 23, 2025
9dec739
mvp
shreyas-goenka Apr 23, 2025
34e5159
got this to a working state after refactor; TODO: cleanup and more te…
shreyas-goenka Apr 23, 2025
a030b3b
lint
shreyas-goenka Apr 23, 2025
fe141a5
-
shreyas-goenka Apr 24, 2025
cb0fde7
fix integration test users
shreyas-goenka Apr 24, 2025
12ed683
-
shreyas-goenka Apr 24, 2025
b4fb7db
Merge remote-tracking branch 'origin' into proxy-integration
shreyas-goenka Apr 24, 2025
d1c13dd
cleanup
shreyas-goenka Apr 24, 2025
7ddb576
add crud test
shreyas-goenka Apr 24, 2025
a2eb106
split tests and add workspace-io test
shreyas-goenka Apr 24, 2025
b32da96
add volume io testcase
shreyas-goenka Apr 24, 2025
9b36628
-
shreyas-goenka Apr 24, 2025
18f08e8
fix test on windows
shreyas-goenka Apr 24, 2025
c5deda8
-
shreyas-goenka Apr 24, 2025
cd8ebc6
fix windows base64
shreyas-goenka Apr 25, 2025
ef2ec73
fix windows newline in raw body
shreyas-goenka Apr 25, 2025
6e5fa12
lint
shreyas-goenka Apr 25, 2025
ee83d69
fix windows newline in raw body again
shreyas-goenka Apr 25, 2025
c95c2b8
pass process env to child process
shreyas-goenka Apr 25, 2025
ab5a324
-
shreyas-goenka Apr 25, 2025
94aaa4a
-
shreyas-goenka Apr 25, 2025
bdddde6
-
shreyas-goenka Apr 25, 2025
609fb7e
cleanup
shreyas-goenka Apr 25, 2025
b9f52cb
-
shreyas-goenka Apr 25, 2025
f2faf04
cleanup
shreyas-goenka Apr 25, 2025
c4e5aa8
final cleanup
shreyas-goenka Apr 25, 2025
3ca94bc
Merge remote-tracking branch 'origin' into proxy-integration
shreyas-goenka Apr 25, 2025
c72a6d7
always record requests in proxy
shreyas-goenka May 5, 2025
55767f1
common code for current-user in PrepareServerAndClient
shreyas-goenka May 5, 2025
573e82c
-
shreyas-goenka May 5, 2025
4861e27
merge
shreyas-goenka May 6, 2025
0830321
merge
shreyas-goenka May 6, 2025
4bd1083
have start functions return host and token directly
shreyas-goenka May 6, 2025
e94556d
undo local server changse
shreyas-goenka May 6, 2025
e61ecc6
reduce diff
shreyas-goenka May 6, 2025
bc39366
-
shreyas-goenka May 6, 2025
38e8901
-
shreyas-goenka May 6, 2025
8e37d99
separate package for the proxy server
shreyas-goenka May 6, 2025
b86da3c
-
shreyas-goenka May 6, 2025
ac6ab14
-
shreyas-goenka May 6, 2025
a2639f0
-
shreyas-goenka May 6, 2025
147077f
Merge remote-tracking branch 'origin' into proxy-integration
shreyas-goenka May 7, 2025
ca98d88
-
shreyas-goenka May 7, 2025
0f5a61c
-
shreyas-goenka May 7, 2025
f326379
-
shreyas-goenka May 7, 2025
a748038
-
shreyas-goenka May 7, 2025
6932a81
-
shreyas-goenka May 7, 2025
a52d28e
-
shreyas-goenka May 7, 2025
74cc3a7
-
shreyas-goenka May 7, 2025
958da1f
-
shreyas-goenka May 7, 2025
51a7e26
-
shreyas-goenka May 7, 2025
5a38af7
-
shreyas-goenka May 7, 2025
9111f6f
-
shreyas-goenka May 7, 2025
027d512
-
shreyas-goenka May 7, 2025
f9ecc83
use http server
shreyas-goenka May 7, 2025
bcfa2d2
-
shreyas-goenka May 7, 2025
9a5e10e
address comments
shreyas-goenka May 7, 2025
084a5c3
print requests inline
shreyas-goenka May 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use http server
  • Loading branch information
shreyas-goenka committed May 7, 2025
commit f9ecc8326f8737239b9959fc15982e060c9193e6
17 changes: 6 additions & 11 deletions libs/testproxy/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,14 @@ import (
"github.com/databricks/databricks-sdk-go/apierr"
"github.com/databricks/databricks-sdk-go/client"
"github.com/databricks/databricks-sdk-go/config"
"github.com/gorilla/mux"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

type ProxyServer struct {
*httptest.Server

t testutil.TestingT
router *mux.Router
t testutil.TestingT

apiClient *client.DatabricksClient
RequestCallback func(request *testserver.Request)
Expand All @@ -41,14 +39,8 @@ type ProxyServer struct {
// For reference, see:
// https://github.com/databricks/databricks-sdk-go/blob/79e4b3a6e9b0b7dcb1af9ad4025deb447b01d933/common/environment/environments.go#L57
func New(t testutil.TestingT) *ProxyServer {
router := mux.NewRouter()
server := httptest.NewServer(router)
t.Cleanup(server.Close)

s := &ProxyServer{
Server: server,
t: t,
router: router,
t: t,
}

// Create an API client using the current authentication context.
Expand All @@ -59,7 +51,10 @@ func New(t testutil.TestingT) *ProxyServer {
require.NoError(t, err)

// Set up the proxy handler as the default handler for all requests.
router.NotFoundHandler = http.HandlerFunc(s.proxyToCloud)
server := httptest.NewServer(http.HandlerFunc(s.proxyToCloud))
t.Cleanup(server.Close)

s.Server = server
return s
}

Expand Down
Loading