0

When I run dredd, it seems to just hang after the first api call. I'm not sure how to debug or diagnose. I'm running an asp.net 5 mvc 6 api service with the dnx web command. How can I see what's going on or what the issue might be?

I tried adding hooks for debugging and see that it calls the first api and then just never triggers the after event. I tested the api with postman and curl with correct results. Dredd also works with the same blueprint if I'm using an express node.js server.

The only combination that fails is Dredd with the asp.net kestrel server response. The server logs that the request is made and a response is sent so it does trigger the test, but just never finishes.

Is Dredd looking for some sort of after processing hook, because I see the server receiving the request with dredd regardless of .net or node.js. Even if I spin up the .net api process in another process it doesn't work, why would that matter? It should just be http requests for dredd in any case right?

Does it care that it's coming back from a kestrel server?

kestrel response

Content-Type → application/json; charset=utf-8
Date → Wed, 06 Jan 2016 17:14:10 GMT
Server → Kestrel
Transfer-Encoding → chunked

Body {"foo":"bar"}

dredd.yml

dry-run: null
hookfiles: null
language: nodejs
sandbox: false
server: dnx web
server-wait: 3
init: false
names: false
only: []
output: []
header: []
sorted: false
user: null
inline-errors: false
details: false
method: []
color: true
level: verbose
timestamp: false
silent: false
path: []
blueprint: test.apib
endpoint: 'http://localhost:5000'

console output of dredd command

Starting server with command: dnx web
Waiting 3 seconds for server command to start...
Hosting environment: Production
Now listening on: http://localhost:5000
Application started. Press Ctrl+C to shut down.
info: Beginning Dredd testing...
info: Found Hookfiles: hooks.js
hook: before all
hook: before each
info: Microsoft.AspNet.Hosting.Internal.HostingEngine[1]
      Request starting HTTP/1.1 GET http://localhost:5000/message  
info: Microsoft.AspNet.Mvc.Controllers.ControllerActionInvoker[1]
      Executing action method Foo.Controllers.HelloController.Get with arguments () - ModelState is Valid'
info: Microsoft.AspNet.Mvc.Infrastructure.ObjectResultExecutor[1]
      Executing ObjectResult, writing value Microsoft.AspNet.Mvc.ActionContext.
info: Microsoft.AspNet.Mvc.Infrastructure.MvcRouteHandler[2]
      Executed action Foo.Controllers.HelloController.Get in 0.0165ms
info: Microsoft.AspNet.Hosting.Internal.HostingEngine[2]
      Request finished in 0.041ms 200 application/json; charset=utf-8

test.apib

# GET /message
+ Response 200 (application/json; charset=utf-8)

        {"foo":"bar"}
MonkeyBonkey
  • 46,433
  • 78
  • 254
  • 460
  • Would you mind sharing with me the APIBlueprint you're using? – Vincenzo Jan 06 '16 at 16:25
  • sure, I added the blueprint above and and an updated simpler console output. I used the same blueprint with a node.js express server and it works... just something about making the request against a dnx .net web api.. Is it looking for some sort of processing hook, because I see the server receiving the request. Even if I spin up the api process in another process it doesn't work, why would that matter? It should just be http requests for dredd in any case right? – MonkeyBonkey Jan 06 '16 at 17:10

1 Answers1

0

It is correctly passing on my machine (MacOSX with coreclr mono rc2) The same goes with the nodejs version you provided in the repo.

The only thing I had to change in my application was the startup command: dnx run --server Microsoft.AspNet.Server.Kestrel

but I do not really think that is the problem here.

image

Vincenzo
  • 1,549
  • 1
  • 9
  • 17