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
- 平均合并
- 18 小时 41 分钟
- 30 天内合并 PR
- 45
环境准备
- 提供 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 · 1 条评论 ·
维护者通常 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
-
Python: Bug: split_plaintext_paragraph / split_markdown_paragraph can return a chunk larger than max_tokens可能已有人在做 @xThreeh 今天认领。 未关闭python triage
难度 2/5 1-3 小时 新手友好度 75/100
microsoft/semantic-kernel#14566 ·
维护者通常 4 天内回复
-
triage
难度 1/5 1 小时以内 新手友好度 82/100
rjmurillo/moq.analyzers#1384 ·
-
Variables passed to Compensated are not set on the routing slip可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
MassTransit/MassTransit#6249 ·
-
security
难度 2/5 1-3 小时 新手友好度 82/100
Sendspin/sendspin-dotnet#339 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
owasp-dep-scan/dosai#79 ·
维护者通常 1 天内回复