mirror of https://github.com/databricks/cli.git
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:
parent
ddedc4272d
commit
6953a84db6
|
@ -318,7 +318,7 @@ func runTest(t *testing.T, dir, coverDir string, repls testdiff.ReplacementsCont
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
for _, req := range server.Requests {
|
for _, req := range server.Requests {
|
||||||
reqJson, err := json.Marshal(req)
|
reqJson, err := json.MarshalIndent(req, "", " ")
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
reqJsonWithRepls := repls.Replace(string(reqJson))
|
reqJsonWithRepls := repls.Replace(string(reqJson))
|
||||||
|
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue