`flow test --output=json` does not strictly emit JSON data
@chasefleming 已经在做这个了。
开始于 2024年1月2日。
评估
这个 Issue 还没有评估数据。
描述
Instructions
Please fill out the template below to the best of your ability and include a label indicating which tool/service you were working with when you encountered the problem.
Problem
Logs outputted by flow test --output=json are not captured in any way and are emitted to stdio as plaintext. This is problematic because applications which rely on this functionality will fail to parse the output from the Flow CLI.
Steps to Reproduce
Run the command with a test file that emits a log.
Acceptance Criteria
The CLI strictly emits JSON output to stdio. There are multiple solutions for this:
- Suppress logs entirely (probably the easy quick-fix that can be revisited later)
- Extend the output of
flow testto include logs. It's likely this could introduce some breaking changes to the schema of the CLI output and break external consumers, however, this is a relatively new feature so this is probably acceptable in order to migrate to a more robust output format in the long-run. - Output logs directly to stdio in JSON format and stream multiple messages in realtime (this is similar to
flow emulator --log-format json, however requires all consumers be equipped to handle multiple JSON objects in the output). It does, however, offer the benefit of instantly serving in-progress information without waiting for a terminal state.
Context
Currently cadence log() calls break the VSCode Test Runner.
This relies on changes to the Cadence Test Framework (see https://github.com/onflow/cadence-tools/issues/265 https://github.com/onflow/cadence-tools/pull/267)
- 主要语言
- Go
- 星标
- 209
- 派生
- 88
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
onflow/flow-cli 的其他 Issue
-
Simplify MCP contract sorting with slices helpers可能已有人在做 @luangucun 于 47 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
-
`flow cadence lint` lints imports可能已有人在做 @holyfuchs 于 186 天前认领。 未关闭Bug Improvement
难度 2/5 1-3 小时 新手友好度 78/100
-
Bug
难度 3/5 1-2 天 新手友好度 48/100
-
flow test prints unreadable output可能已有人在做 @holyfuchs 于 184 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 55/100
-
Feature
难度 3/5 1-2 天 新手友好度 48/100
相似的 Issue
-
agent-review-finding chore
难度 2/5 1-3 小时 新手友好度 73/100
jordansmall/spindrift#5748 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
-
Resource links written as host:port without a scheme are broken可能已有人在做 @RaphaelFakhri 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
Proxy ignores l5d-retry-http and l5d-retry-grpc conditions that follow a comma and space可能已有人在做 @RaphaelFakhri 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 3 天内回复
-
needs_triage
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 2 天内回复