Commit Graph

17 Commits

Author SHA1 Message Date
Tolga Ceylan
9584643142 fn: size restricted tmpfs /tmp and read-only / support (#1012)
* fn: size restricted tmpfs /tmp and read-only / support

*) read-only Root Fs Support
*) removed CPUShares from docker API. This was unused.
*) docker.Prepare() refactoring
*) added docker.configureTmpFs() for size limited tmpfs on /tmp
*) tmpfs size support in routes and resource tracker
*) fix fn-test-utils to handle sparse files better in create file

* test typo fix
2018-05-25 14:12:29 -07:00
Tolga Ceylan
00bb4d1257 fn: empty body tests for cold and hot (json/http) (#941) 2018-04-13 10:35:57 -07:00
Tolga Ceylan
7b5b091698 fn: update fn dependencies for go 1.10 (#856) 2018-03-14 09:18:30 -07:00
Tolga Ceylan
7677aad450 fn: I/O related improvements (#809)
*) I/O protocol parse issues should shutdown the container as the container
goes to inconsistent state between calls. (eg. next call may receive previous
calls left overs.)
*) Move ghost read/write code into io_utils in common.
*) Clean unused error from docker Wait()
*) We can catch one case in JSON, if there's remaining unparsed data in
decoder buffer, we can shut the container
*) stdout/stderr when container is not handling a request are now blocked if freezer is also enabled.
*) if a fatal err is set for slot, we do not requeue it and proceed to shutdown
*) added a test function for a few cases with freezer strict behavior
2018-03-07 15:09:24 -08:00
Tolga Ceylan
37ee5f6823 fn: runner tests and test-utils enhancements (#807)
This is prep-work for more tests to come.

*) remove http response -1, this will break in go 1.10
*) add docker id & hostname to fn-test-utils (will be useful
   to check/test which instance a request landed on.)
*) add container start/stop logs in fn-test-utils. To detect
   if/how we miss logs during container start & end.
2018-03-01 12:49:17 -08:00
Tolga Ceylan
820baf36dc fn: clean api tests: removed multi log (#801)
fn-test-utils covers this, with sleep in between.
2018-02-27 21:03:03 -08:00
Reed Allman
a56d204450 fix up response headers (#788)
* fix up response headers

* stops defaulting to application/json. this was something awful, go stdlib has
a func to detect content type. sadly, it doesn't contain json, but we can do a
pretty good job by checking for an opening '{'... there are other fish in the
sea, and now we handle them nicely instead of saying it's a json [when it's
not]. a test confirms this, there should be no breakage for any routes
returning a json blob that were relying on us defaulting to this format
(granted that they start with a '{').
* buffers output now to a buffer for all protocol types (default is no longer
left out in the cold). use a little response writer so that we can still let
users write headers from their functions. this is useful for content type
detection instead of having to do it in multiple places.
* plumbs the little content type bit into fn-test-util just so we can test it,
we don't want to put this in the fdk since it's redundant.

I am totally in favor of getting rid of content type from the top level json
blurb. it's redundant, at best, and can have confusing behaviors if a user
uses both the headers and the content_type field (we override with the latter,
now). it's client protocol specific to http to a certain degree, other
protocols may use this concept but have their own way to set it (like http
does in headers..). I realize that it mostly exists because it's somewhat gross
to have to index a list from the headers in certain languages more than
others, but with the ^ behavior, is it really worth it?

closes #782

* reset idle timeouts back

* move json prefix to stack / next to use
2018-02-27 10:30:33 -08:00
Tolga Ceylan
95d64f3aa9 fn: minor test improvements (#794) 2018-02-26 16:10:40 -07:00
Tolga Ceylan
0e3df87424 fn: fn-test-utils adjustments for fdk-go (#775) 2018-02-14 16:58:20 -08:00
Tolga Ceylan
4dca70c02f fn: fn-test-utils: partial output and invalid http or json (#756)
Simulate partial output or invalid json/html in fn-test-utils.
2018-02-12 10:20:06 -08:00
Tolga Ceylan
bed3b5ddff fn: more functionality into fn-test-utils (#752)
read/write a file on disk, alloc/leak memory.
2018-02-09 13:23:40 -08:00
Tolga Ceylan
15c0d7a99f fn: fn-test-utils fdk-go dep update (#743) 2018-02-05 16:16:45 -08:00
Tolga Ceylan
6f1f5e365d fn: URL parsing updates to fix json request_url (#657)
*) Updated fn-test-utils to latest fdk-go
*) Added hot-json to runner tests
*) Removed anon function in FromRequest which had
a side effect to set req.URL.Host. This is now more
explicit and eliminates some corresponding logic in
protocol http.
*) in gin, http request RequestURI is not set, removed
code that references this. (use Call.URL instead)
2018-01-08 10:28:50 -08:00
Tolga Ceylan
d329e0ef5b fn: circleci and makefile adjustments (#625)
* fn: circleci and makefile adjustments

*) Moved more tasks into Makefile to allow for
parallelism and dependency checks.
*) Added cpu count in circleci make invocations
for parallelism

* fn: typo sqlite => sqlite3

* fn: removed unnecessary make pull & install
2017-12-23 10:12:18 -06:00
Reed Allman
f51792ae5e Timestamps on apps / routes (#614)
* route updated_at

* add app created at, fix some route updated_at bugs

* add app updated_at

TODO need to add tests through front end
TODO for validation we don't really want to use the validate wrapper since
it's a programmer error and not a user error, hopefully tests block this.

* add tests for timestamps to exist / change on apps&routes

* route equals at done, fix tests wit dis

* fix up the equals sugar

* add swagger

* fix rebase

* precisely allocate maps in clone

* vetted

* meh

* fix api tests
2017-12-23 09:57:36 -06:00
Tolga Ceylan
8c081e47b9 fn: remove unnecessary packages from fm-test-utils image (#619) 2017-12-21 15:46:44 -06:00
Tolga Ceylan
b3f7c7fc7f fn: add tester image (#609)
* fn: add fn-test-utils image

New tester image that uses go-fdk for advanced test scenarios.
Right now, this is an enhanced 'hello/sleeper' rolled into one
that echos the received headers/env to allow writing test cases.
2017-12-19 15:06:16 -08:00