[comixed-dev] Re: Add front code coverage to sonarcloud ?

  • From: "Darryl L. Pierce" <mcpierce@xxxxxxxxx>
  • To: comixed-dev@xxxxxxxxxxxxx
  • Date: Mon, 15 Jun 2020 08:14:49 -0400

Good suggestions. I'll try them out on my fork of the project and see if
the coverage gets better.

On Sun, Jun 14, 2020 at 4:10 PM Frédéric Fouret <fouretfrederic@xxxxxxxxx>
wrote:

I'm not a SonarCloud expert (i used it only one time for a school
project). I'm not an expert in front testing too :) But when I see only
29.2% of test coverage and only 551 unit Tests it's frustrating because
there is more than 95% of the front with unit tests.
It's not very important but it's good for the quality image of the work
that's been done.

I've searched for some modification to test.
Actually when the front phase testing is done, it seems there is no
coverage report generated. If we replace in the package.json (in
frontend) "test": "ng test" by "test": "ng test --code-coverage", and if we
add in karma.conf.js in coverageIstanbulReporter the line : "dir:
require('path').join(__dirname, '../coverage')," the coverage is generated
in html format and in Icov.info format (in a folder
comixed-frontend/coverage).
Now we just need to say to sonar where to find this Icov report. Seems we
just need to add the option -Dsonar.javascript.lcov.reportPaths=coverage/
lcov.info to the run job in sonarcloud-analysis.yml.

As I said, I don't know much about sonarcloud and that's why I don't make
changes directly in the code... Maybe what I'm proposing doesn't work at
all... maybe one day you'll have a little time to try and see if these
modifications can solve the lack of front coverage.



Le dim. 14 juin 2020 à 18:21, Darryl L. Pierce <mcpierce@xxxxxxxxx> a
écrit :

I thought it was already in there. At least, it's there enough to give
errors when there's something missing in the froent. For example,  I just
finished fixing some issues it brought up with the changes I've made for an
enhancement to let users see the contents of a comic file's archive.

I'm not a SonarCloud expert so am not sure what we can do to make the
testing better. But I'm open to whatever can be done to achieve better,
more reliable feedback from it.

On Sun, Jun 14, 2020 at 11:53 AM Frédéric Fouret <
fouretfrederic@xxxxxxxxx> wrote:

Today I went to look at the sonarcloud of the project. We're seeing weak
code coverage and quality gate failed.... It's a pity because there is a
lot of testing done on the frontend that is not taken into account.

Can we add frontend code coverage to sonarcloud ?




--
Darryl L. Pierce <mcpierce@xxxxxxxxx>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap together." -
Gord Downie



-- 
Darryl L. Pierce <mcpierce@xxxxxxxxx>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap together." - Gord
Downie

Other related posts: