Skip to content

Commit 082f194

Browse files
authored
acc: fix -logrequests option (#3731)
It was only enabled where there was a dedicated server started for this test.
1 parent 9da7f7d commit 082f194

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

acceptance/acceptance_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ func testAccept(t *testing.T, inprocessMode bool, singleTest string) int {
228228
cloudEnv := os.Getenv("CLOUD_ENV")
229229

230230
if cloudEnv == "" {
231-
internal.StartDefaultServer(t)
231+
internal.StartDefaultServer(t, LogRequests)
232232
if os.Getenv("TEST_DEFAULT_WAREHOUSE_ID") == "" {
233233
t.Setenv("TEST_DEFAULT_WAREHOUSE_ID", "8ec9edc1-db0c-40df-af8d-7580020fe61e")
234234
}

acceptance/internal/prepare_server.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,15 @@ import (
2525
"github.com/stretchr/testify/require"
2626
)
2727

28-
func StartDefaultServer(t *testing.T) {
28+
func StartDefaultServer(t *testing.T, logRequests bool) {
2929
s := testserver.New(t)
3030
testserver.AddDefaultHandlers(s)
3131

32+
// Log API responses if the -logrequests flag is set.
33+
if logRequests {
34+
s.ResponseCallback = logResponseCallback(t)
35+
}
36+
3237
t.Setenv("DATABRICKS_DEFAULT_HOST", s.URL)
3338

3439
// Do not read user's ~/.databrickscfg.

0 commit comments

Comments
 (0)