Commit Graph

5 Commits

Author SHA1 Message Date
Denis Bilenko adee4c9998 fix syntax_error in fake workspace 2025-02-12 12:55:16 +01:00
Denis Bilenko fe96f80de1 testserver: auto-create directories when importing a file 2025-02-12 12:55:16 +01:00
Denis Bilenko c9beddc97a Do not convert nil to 404 2025-02-12 12:54:55 +01:00
Denis Bilenko abea174a6a acc: Simplify writing handlers; support customing headers; fix read body bug
Handlers now receive testserver.Request and return any which could be
- nil (returns 404)
- string / []byte (returns it as is but sets content-type to json or test depending on content)
- object (encodes it as json and sets content-type to json)
- testserver.Response (full control over status, headers)

The config is now using the same testserver.Response struct as handlers, so the same logic applies there.

It is now possible to specify headers in test.toml.

This also fixes a bug with RecordRequest reading the body, not leaving it for the actual handler.
2025-02-12 12:54:55 +01:00
Gleb Kanterov 75127fe42e
Extend testserver for deployment (#2299)
## Changes
Extend testserver for bundle deployment:

- Allocate a new workspace per test case to isolate test cases from each
other
- Support jobs get/list/create
- Support creation and listing of workspace files

## Tests
Using existing acceptance tests
2025-02-07 10:26:20 +00:00