2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Flutterで導入しているCodecovで genhtml: command not foundと出た時の対処

Posted at

ジョインさせていただいているチームでFlutterアプリを開発しているんですが Codecov を導入していて、ローカルCLI上でコマンド叩いてカバレッジレポートを生成しようとすると genhtml: command not found と出て色々調べてもあまり何も出てこなかったのでメモ!

flutter test --coverage
genhtml coverage/lcov.info -o coverage/html

とやると

genhtml: command not found

と出たので最初$PATHが通っていないのかな?と思っていたのですが、そもそも lcov が入っていないことがわかったので早速インストール
HomebrewでインストールするのでHomebrewが入っていない場合は下記のコマンドを実行してください。

  • Homebrewインストール
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null

画面でパスワードの入力を求められた場合は、Macのユーザーパスワードを入力して続行してください。そして、コマンドが完了するまで待ちます。

完了したら、lcovをHomebrewでインストール

brew install lcov

以上で完了なので下記を実行するとカバレッジレポートがブラウザ(Chrome.app)で表示されます。
※Chrome.app以外をお使いの場合は /Applications/Google Chrome.app の部分を書き換えてください。

flutter test --coverage
genhtml coverage/lcov.info -o coverage/html
open -a '/Applications/Google Chrome.app' coverage/html/index.html 

開発環境

Mac OS Catelina 10.15.4

参考文献

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?