heartpoints / heartpoints.org

3 stars 4 forks source link

Code coverage #181

Closed tommysullivan closed 5 years ago

tommysullivan commented 5 years ago

ok! so i got this thing producing code coverage locally when one runs hp cover or yarn cover; it shows up if you have the Code Coverage Highlighter plugin in VS Code, pic included. In CircleCI, it will detect the environment and then from within the container, send the coverage results to codecov.io. This updates our PR with info linking us to the cov report. From there we can also link back to the circleCI job or related commits. Looking pretty decent as a first stab.

also i had to break up that huge heartpoints.sh file it was driving me nuts. way too much code for one file. even now its a bit bigger than i would like and i discovered a little messiness / duplication around how we run and test in local mac, docker on mac, minikube on mac, circle ci and production kubernetes on gcm. will want to come back to that at some future point maybe when we are in there fixing a bug or enhancing for other reasons.

Note that the report is browsable, but that the default "diff" view of the report shows warning because master does not yet have a report. but one can nav to files to view instant in time coverage for this PR's several successfully reported commits to demonstrate that it does seem to work.

note that i did not attempt to add the github inline viewer plugin that makes codecov reporting easier. @bob-bins mentioned that gitlab may have a way to view coverage inline in the web view without needing browser plugin; that sounds interesting!

btw: our test coverage is pretty low! in future versions we can employ rules, for example "code coverage can't decrease". we should also start testing more. since i now have lots of ugly squigglies in my code showing me what is untested it makes me want to do more testing automatically :)

Screen Shot 2019-09-14 at 8 21 45 PM (2)

codecov[bot] commented 5 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@4c29a7d). Click here to learn what that means. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #181   +/-   ##
=========================================
  Coverage          ?   29.71%           
=========================================
  Files             ?      234           
  Lines             ?     1400           
  Branches          ?       81           
=========================================
  Hits              ?      416           
  Misses            ?      984           
  Partials          ?        0

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4c29a7d...20e59b0. Read the comment docs.