npx hardhat coverage fails - stack too deep

オープン
#190 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
javascript, solidity
領域
testing-qa

調査の方向性

Reproduce the failure with npm install followed by npx hardhat coverage --show-stack-traces, then inspect .solcover.js and the coverage configuration around the reported stack-too-deep error. Compare the existing viaIR, exclusion, and @skip-on-coverage attempts. Done means coverage completes successfully for the intended Solidity files.

索引モデルが issue の本文から書いたものです。

説明

npx hardhat coverage --show-stack-traces

Version
=======
> solidity-coverage: v0.8.12

Instrumenting for coverage...
=============================

> APIConsumer.sol
> AutomationCounter.sol
> PriceConsumerV3.sol
> RandomNumberConsumerV2Plus.sol
> RandomNumberDirectFundingConsumerV2Plus.sol
> test/VRFCoordinatorV2_5Mock.sol
> VRFV2PlusWrapper.sol

Coverage skipped for:
=====================

> test/fuzzing/AutomationCounterEchidnaTest.sol
> test/MockLinkToken.sol
> test/MockOracle.sol
> test/MockV3Aggregator.sol

Compilation:
============

CompilerError: Stack too deep. Try compiling with `--via-ir` (cli) or the equivalent `viaIR: true` (standard JSON) while enabling the optimizer. Otherwise, try removing local variables. When compiling inline assembly: Variable headStart is 1 slot(s) too deep inside the stack. Stack too deep. Try compiling with `--via-ir` (cli) or the equivalent `viaIR: true` (standard JSON) while enabling the optimizer. Otherwise, try removing local variables.

after checking out, npm install, npx hardhat compile, npx hardhat test, I am trying to get the code coverage.
It fails with stack too deep. In order to solve the above issue, I tinkered around with

  • enabling the via-ir flag
  • excluding more/all of the .sol files in .solcover.js
  • adding a @skip-on-coverage to the test definitions ( it("testname [ @skip-on-coverage ]", async () => {}))

but with none of those i was able to get code coverage running

Any hint is appreciated to help me understand how to get code coverage for the code to run.

主要言語
JavaScript
スター
1.3k
フォーク
510
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

smartcontractkit/hardhat-starter-kit のほかの issue

smartcontractkit/hardhat-starter-kit の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。