Fork me on GitHub
#yada
<
2016-12-07
>
genRaiy08:12:36

I wonder if you have some preferences at JUXT for testing HTTP? I looked into edge and doesn’t have anything...

genRaiy08:12:43

I mean for standing up a http server and hitting its endpoints

malcolmsparks08:12:05

There are examples in yada's own test dir

malcolmsparks08:12:52

You can create test 'systems' of (Stuart Sierra) components that are triggered with fixtures

malcolmsparks09:12:14

Yes, edge needs more testing stuff.

tcoupland09:12:47

it's just what malcom said, fixture to stand the thing up, then proding it 🙂

genRaiy09:12:01

@tcoupland thanks - I don’t use component but I get the idea

genRaiy09:12:23

@tcoupland you have written a fair bit of homemade code (wait-for-url, etc...) / macros (has-status, etc...) in your base.clj

genRaiy09:12:46

I guess you couldn’t find anything out there for these conveniences?

genRaiy09:12:54

@malcolmsparks in yada it seems you are using mocks rather than standing up a server or am I looking in the wrong places?

malcolmsparks09:12:00

There are cases of both

malcolmsparks09:12:12

Standing up a server is my preference for apps

tcoupland09:12:28

@raymcdermott true, there is quite a bit of stuff in there for that. I don't think they are that common/don't really look for such simple bits and bobs

malcolmsparks09:12:44

Let mw check when I'm on my laptop and get back to you

genRaiy09:12:48

has most of this stuff

tcoupland09:12:59

ah, well it's a little different. The application is event driven, so responses happen immediately, but entities will be created once the events have been consumed and different tests are looking for different entities and entity states.

genRaiy09:12:54

ok, cool - if its different you need something else 😉

stijn09:12:02

when we switched from yada pre 1.0 to 1.1 we have created a test suite that generates requests to 2 servers on different git commits and compares them for compatibility. the old version of the server needed to be started manually, but the new one was started with component. requests were submitted by aleph's http client. I probably need to automate this, so we can run these tests on every release 🙂

tcoupland09:12:43

that sounds pretty nifty 🙂

genRaiy09:12:45

@stijn good call on using the aleph http client

kurt-yagram10:12:29

is there an example somewhere of how to upload a list of files with yada?

malcolmsparks10:12:49

upload.clj in the yada repo shows a simple upload.

malcolmsparks10:12:04

You can use multipart to upload many files in one go

malcolmsparks10:12:22

Yada fully supports multipart and it's well tested

kurt-yagram10:12:29

allright, thx

kurt-yagram11:12:49

Hence, the question is: how to define the swaggered api/resource?

kurt-yagram12:12:40

... or is it not possible to have this swaggered?

ikitommi14:12:55

@kurt-yagram the ring multipart sadly requires servlet dep, see https://github.com/ring-clojure/ring/issues/251. You can add File->Swagger conversion yourself, something like (defmethod ring.swagger.json-schema/convert-class java.io.File [_ _] {:type "file"}).

kurt-yagram14:12:58

I'll give it a try... thx

stijn14:12:28

@malcolmsparks when I return a deferred from a verify function in the authentication-schemes, yada will always consider this as a truthy value, no matter what the contents of the deferred are (error or nil e.g.)

stijn14:12:19

meaning that 'authentication' for that verify function will succeed

stijn14:12:44

is this intended and should I work around this in the authorization part by implementing a validate method that will work with deferreds?

stijn14:12:46

ok, reading the comments in yada.security/authenticate it makes sense!

stijn14:12:09

will handle it in the validate method

jondejung23:12:56

Hello Everyone

jondejung23:12:06

Anyone available for a quick yada question?