flow test prints unreadable output
評価
調査の方向性
まず、cadence/tests/yield_vaults_strategy_vault_test.cdc に示されているデプロイ順序の失敗シナリオで flow test を実行し、次に helpers/deployment_helpers.cdc:52 の報告された箇所を追跡します。テストの失敗時に、エスケープされた内部 Cadence ラッパーや過剰なパディング、読みにくい生のエラー出力が出力されなくなれば作業は完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary
When a Cadence test deploys contracts in the wrong dependency order or similar issues, flow test prints hundreds of lines of raw, unformatted output that is nearly impossible to read and lags the terminal.
Current Behavior
The CLI outputs the full internal Cadence representation of the error, including the I.Test.Test.Error(message: "...") wrapper with all nested error chains encoded as an escaped string. Every line of the output is also padded with trailing spaces to a fixed column width. Example:
flow test
❌ Command Error: error in test file "cadence/tests/yield_vaults_strategy_vault_test.cdc": Execution failed:
error: assertion failed: given value is: I.Test.Test.Error(message: "[Error Code: 1101] error caused by: 1 error occurred:\n\t* transaction execute failed: [Error Code: 1101] cadence runtime error: Execution failed:\nerror: cannot deploy invalid contract\n --> 69f412eecfa8b27d65c15b19943ed0d8a00b87d89ca7e7fabb309dc13b400084:5:20\n |\n5 | signer.contracts.add(name: \"FlowYieldVaultsInterfaces\", code: \"696d706f72742046756e6769626c65546f6b656e2066726f6d203078303030303030303030303030303030320a696d706f727420466c6f77416374696f6e732066726f6d203078303030303030303030303030303030370a0a61636365737328616c6c2920636f6e747261637420466c6f775969656c645661756c7473496e7465726661636573207b0a0a2020202061636365737328616c6c292073747275637420696e74657266616365205374726174656779207b0a202020202020202061636365737328616c6c292066756e20637... \n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nerror: cannot find declaration `FlowActions` in `0000000000000007.FlowActions`\n --> 0000000000000007.FlowYieldVaultsInterfaces:2:7\n |\n2 | import FlowActions from 0x0000000000000007\n | ^^^^^^^^^^^ available exported declarations are:\n\n\n See documentation at: https://cadence-lang.org/docs/language/imports\n\nWas this error unhelpful?\nConsider suggesting an improvement here: https://github.com/onflow/cadence/issues.\n\n\n")
--> helpers/deployment_helpers.cdc:52:4
Was this error unhelpful?
Consider suggesting an improvement here: https://github.com/onflow/cadence/issues.
- thousands of whitespaces, which need text wrapping lagging the terminal
The output frequently exceeds 200 lines for a single assertion failure.
Expected Behavior
The CLI should display only the actionable Cadence errors (compiler/checker errors, type errors, etc.) with their source locations, without the [Error Code: 1101] transaction wrapper, the cannot deploy invalid contract outer block, or the raw I.Test.Test.Error(message: "...") encoding. Example:
❌ Test Error: cadence/tests/yield_vaults_test.cdc
Assertion failed at: helpers/deployment_helpers.cdc:55:4
error: cannot find declaration `FlowYieldVaults` in `0000000000000007.FlowYieldVaults`
--> 0000000000000007.FlowYieldVaultsAdmin:1:7
error: ambiguous intersection type
--> 0000000000000007.FlowYieldVaultsAdmin:23:62
Steps to Reproduce
- Write 2 contracts
- A includes B
- deploy A
- 主要言語
- Go
- スター
- 209
- フォーク
- 88
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
onflow/flow-cli のほかの issue
-
Simplify MCP contract sorting with slices helpers対応中かも @luangucun が 33 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
`flow cadence lint` lints imports対応中かも @holyfuchs が 172 日前に担当しました。 オープンBug Improvement
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
Bug
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
-
Feature
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
onflow/flow-cli の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
appbaseio/reactivesearch-api#402 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
router-for-me/CLIProxyAPI#6399 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 2 日以内に返信
-
settings.py flaps between reconciles: needsMigrationSetting depends on map iteration order対応中かも @fontaineajulien が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
pulp/pulp-operator#1691 ·