2016-01-05 28 views
0

當我運行dredd時,它似乎只是在第一個api調用後掛起。我不知道如何調試或診斷。我正在使用dnx web命令運行一個asp.net 5 mvc 6 api服務。我怎樣才能看到發生了什麼事情或者問題是什麼?Dredd似乎掛着api調用asp.net kestrel服務器

我試着添加鉤子進行調試,看到它調用了第一個API,然後從未觸發過事件。我用郵差和捲曲測試了api並獲得了正確的結果。如果我使用express node.js服務器,Dredd也可以使用相同的藍圖。

唯一失敗的組合是使用asp.net kestrel服務器響應Dredd。服務器記錄發出請求併發送響應,以便它觸發測試,但只是永遠不會結束。

Dredd正在尋找某種處理後的鉤子,因爲我看到服務器接收到與dredd無關的請求.net或node.js.即使我在另一個進程中啓動.net api進程,它也不起作用,爲什麼這很重要?它應該只是http請求在任何情況下的dredd權利?

它是否在意它從kestrel服務器回來?

隼響應

dredd.yml

控制檯輸出test.apib的

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

Body {"foo":"bar"} 

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' 

dredd命令

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 

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

     {"foo":"bar"} 
+0

您介意與我分享您正在使用的APIBlueprint嗎? – Vincenzo

+0

當然,我在上面添加了藍圖,並更新了更簡單的控制檯輸出。我使用了與node.js express服務器相同的藍圖,它的工作原理...只是對dnx .net web api提出請求。它是否在尋找某種處理鉤子,因爲我看到服務器正在接收請求。即使我在另一個進程中啓動api進程,它也不起作用,爲什麼這很重要?它應該只是http請求在任何情況下的dredd權利? – MonkeyBonkey

回答

0

它正確地在我的機器上傳遞(MacOSX與coreclr單聲道rc2) 您在回購中提供的nodejs版本也是如此。

我在我的應用程序來改變唯一的辦法就是啓動命令: dnx run --server Microsoft.AspNet.Server.Kestrel

,但我真的不認爲這是問題在這裏。

image

相關問題