mirror of https://github.com/databricks/cli.git
## Changes This PR fails the acceptance test when an unknown endpoint (i.e. not stubbed) is used. We want to ensure that all API endpoints used in an acceptance test are stubbed and do not otherwise silently fail with a 404. The logs on failure output include a configuration that developers can simply copy-paste to `test.toml` to stub the missing API endpoint. It'll look something like: ``` [[Server]] Pattern = "<method> <path>" Response.Body = ''' <response body here> ''' Response.StatusCode = <response status-code here> ``` ## Tests Manually: output.txt when an endpoint is not found: ``` >>> [CLI] jobs create --json {"name":"abc"} Error: No stub found for pattern: POST /api/2.1/jobs/create ``` How this renders in the test logs: ``` --- FAIL: TestAccept/workspace/jobs/create (0.03s) server.go:46: ---------------------------------------- No stub found for pattern: POST /api/2.1/jobs/create To stub a response for this request, you can add the following to test.toml: [[Server]] Pattern = "POST /api/2.1/jobs/create" Response.Body = ''' <response body here> ''' Response.StatusCode = <response status-code here> ---------------------------------------- ``` Manually checked that the debug mode still works. |
||
---|---|---|
.. | ||
auth | ||
cmdgroup | ||
cmdio | ||
databrickscfg | ||
dbr | ||
diag | ||
dyn | ||
env | ||
errs | ||
exec | ||
fakefs | ||
filer | ||
fileset | ||
flags | ||
folders | ||
git | ||
iamutil | ||
jsonschema | ||
locker | ||
log | ||
notebook | ||
process | ||
python | ||
set | ||
sync | ||
tags | ||
telemetry | ||
template | ||
terraform | ||
testdiff | ||
testfile | ||
testserver | ||
textutil | ||
vfs |