Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

`flow test --output=json` does not strictly emit JSON data

Đang mở
#1,324 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

@chasefleming đang làm issue này rồi.

Từ ngày 2/1/2024.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

Feedback
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 test to 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)

Ngôn ngữ chính
Go
Star
209
Fork
88
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của onflow/flow-cli

Tất cả issue của onflow/flow-cli

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.