Serialize recorded requests with indentation in acceptance tests (#2329)

## Changes
This PR indents the recorded requests to make them easier to review.
They can still be parsed using jq.

## Tests
Existing tests.
This commit is contained in:
shreyas-goenka 2025-02-10 19:03:27 +05:30 committed by GitHub
parent ddedc4272d
commit 6953a84db6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 23 additions and 3 deletions

View File

@ -318,7 +318,7 @@ func runTest(t *testing.T, dir, coverDir string, repls testdiff.ReplacementsCont
require.NoError(t, err)
for _, req := range server.Requests {
reqJson, err := json.Marshal(req)
reqJson, err := json.MarshalIndent(req, "", " ")
require.NoError(t, err)
reqJsonWithRepls := repls.Replace(string(reqJson))

View File

@ -1 +1,7 @@
{"method":"POST","path":"/api/2.1/jobs/create","body":{"name":"abc"}}
{
"method": "POST",
"path": "/api/2.1/jobs/create",
"body": {
"name": "abc"
}
}

View File

@ -1 +1,15 @@
{"headers":{"Authorization":["Bearer [DATABRICKS_TOKEN]"],"User-Agent":["cli/[DEV_VERSION] databricks-sdk-go/[SDK_VERSION] go/[GO_VERSION] os/[OS] cmd/jobs_create cmd-exec-id/[UUID] auth/pat"]},"method":"POST","path":"/api/2.1/jobs/create","body":{"name":"abc"}}
{
"headers": {
"Authorization": [
"Bearer [DATABRICKS_TOKEN]"
],
"User-Agent": [
"cli/[DEV_VERSION] databricks-sdk-go/[SDK_VERSION] go/[GO_VERSION] os/[OS] cmd/jobs_create cmd-exec-id/[UUID] auth/pat"
]
},
"method": "POST",
"path": "/api/2.1/jobs/create",
"body": {
"name": "abc"
}
}