Enhancement: define failure rate for each mocked response
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
首先找出 ms-dev-proxy 中處理 responses.json 的命令列邏輯,以及套用模擬回應的程式碼。釐清要求的工作是否包括替代的回應檔案路徑、每個回應的失敗率,或兩者皆包括,然後在實作前定義回應設定與可觀察的行為。完成條件應包括已記錄的選項,以及涵蓋所選情境的測試。
由索引模型根據 Issue 內容生成。
描述
Background
Currently, I am researching if we may use the ms-dev-proxy as a tool to support us in integration/manual/QA tests for our apps, and mocking responses is just the perfect functionality we could use 😉.
Idea
- Currently the ms-dev-proxy will look for
responses.jsonfile in the working directory which is just perfect to keep mock related to the app in the projects folder. What I was thinking is maybe ms-dev-proxy could have a new option that would allow specifying the relative path to theresponse.jsonwith mocks to be used. Maybe something like-r --responses-file-path(optional). The aim for this would be to have different test scenarios with different mocks for the same app and then use them as part of integration tests. That way I could keep something like
.
├── MyApp
├── TestScenarios
│ ├── groups-fail-timeout-responses.json
│ └── throttle-responses.json
In this case, each integration test could start the ms-dev-proxy giving different responses.json mocks as param.
TBH this is very low 😉 (and probably stupid) idea as the current workaround I have for it is:
- keep
responses.jsonin subfolders and run the ms-dev-proxy in the subfolder with correct mocks as working directory - the test may just copy/paste the needed
responses.jsonfile to be used for this test.
- Second idea I had (sorry for adding 2 ideas in one issue, I am a bit lazy and running out of time 😝), is to give possibility to define the failure rate for each mocked response in case we are mocking error response.
- 主要語言
- C#
- 星號
- 832
- 分支
- 90
- 平均合併
- 17 小時 54 分鐘
- 30 天內合併 PR
- 47
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
dotnet/dev-proxy 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 85/100
維護者通常 1 天內回覆
-
waiting for response
難度 4/5 3-5 天 新手友好度 28/100
dotnet/dev-proxy#1914 · 2 則留言 ·
維護者通常 1 天內回覆
-
MockStdioResponsePlugin: @stdin.body.id placeholder fails to resolve when messages arrive back-to-back after an id-less message可能重新可做 @garrytrinder 於 86 天前認領,目前沒有進行中的 PR。 未關閉
dotnet/dev-proxy#1757 · 1 個 reaction · 已指派 2 人 ·
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 55/100
維護者通常 1 天內回覆
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 68/100
stryker-mutator/stryker-net#3892 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 65/100
MobiFlight/MobiFlight-Connector#3419 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 82/100
Kryptos-FR/MarkView.Avalonia#105 ·
維護者通常 1 天內回覆
-
[辞書]未關閉提案 辞書
難度 2/5 1-3 小時 新手友好度 65/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
microsoft/fluentui-blazor#5410 ·
維護者通常 1 天內回覆