databricks-cli/acceptance/bundle
Denis Bilenko 4034766c93
acc: Simplify writing handlers; support headers in responses (#2338)
## Changes

Handlers now receive testserver.Request and return any which could be
- string or []byte (returns it as is but sets content-type to json or
plain text depending on content)
- struct (encodes it as json and sets content-type to json)
- testserver.Response (full control over status and headers)

Note if testserver.Response is returned from the handler, it's Body
attribute can still be an object. In that case, it'll be serialized and
appropriate content-type header will be added.

The config is now using the same testserver.Response struct, the same
logic applies both configured responses and responses returned from
handlers.

As a result, one can set headers both in Golang handlers and in
test.toml.

This also fixes a bug with RecordRequest not seeing the body if it was
already consumed by the handler.

## Tests
- Existing rests. 
- acceptance/selftest/server is extended to set response header.
2025-02-12 13:00:57 +00:00
..
artifacts/same_name_libraries Raise an error when there are multiple local libraries with the same basename used (#2297) 2025-02-07 17:55:16 +00:00
debug acc: Simplify writing handlers; support headers in responses (#2338) 2025-02-12 13:00:57 +00:00
generate/git_job Added support to generate Git based jobs (#2304) 2025-02-07 18:37:03 +00:00
git-permerror Always print warnings and errors; clean up format (#2213) 2025-02-07 11:29:40 +00:00
help acc: Use [VARNAME] instead of $VARNAME (#2282) 2025-02-03 14:10:19 +00:00
includes/non_yaml_in_include accept JSON includes (#2265) 2025-02-04 19:28:19 +01:00
override acc: Use [VARNAME] instead of $VARNAME (#2282) 2025-02-03 14:10:19 +00:00
paths acc: Use [VARNAME] instead of $VARNAME (#2282) 2025-02-03 14:10:19 +00:00
quality_monitor acc: Use [VARNAME] instead of $VARNAME (#2282) 2025-02-03 14:10:19 +00:00
scripts acc: enable bundle/scripts on cloud (#2313) 2025-02-07 17:42:47 +00:00
syncroot acc: Use [VARNAME] instead of $VARNAME (#2282) 2025-02-03 14:10:19 +00:00
templates acc: Split bundle/templates and bundle/templates-machinery (#2317) 2025-02-10 11:55:34 +01:00
templates-machinery acc: Split bundle/templates and bundle/templates-machinery (#2317) 2025-02-10 11:55:34 +01:00
undefined_resources Migrate bundle/tests/undefined_resources_test.go to acceptance test (#2106) 2025-01-09 15:21:24 +00:00
variables Append newline to "-o json" for validate/summary/run (#2326) 2025-02-10 14:00:49 +01:00