Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

zsh: command not found: genhtml (Flutter + Code Coverage using Codemagic)

I'm new in DevOps, I want to create code coverage from unit testing result in Flutter.

And this is our command to run that:

flutter test --coverage && genhtml coverage/lcov.info --output=coverage

And this is the result:

00:03 +1: All tests passed!                                                                                                                                                                         
zsh: command not found: genhtml

Does somebody know how to fix it?

And also when I running this:

open coverage/index.html

This is the result:

The file /Users/rrifafauzikomara/Documents/speed-interviews-flutter/coverage/index.html does not exist.

Does somebody know how to fix it?

This is my tutorial that I followed

like image 313
R Rifa Fauzi Komara Avatar asked Aug 02 '26 14:08

R Rifa Fauzi Komara


1 Answers

You need to install "lcov" to access genhtml command.

On windows:

sudo apt-get update sudo apt-get install lcov

On macOS:

brew install lcov

You can get commands for more platforms here: https://command-not-found.com/genhtml

like image 181
Ronak Punase Avatar answered Aug 05 '26 08:08

Ronak Punase