vmware-tanzu / tanzu-framework

Tanzu Framework provides a set of building blocks to build atop of the Tanzu platform and leverages Carvel packaging and plugins to provide users with a much stronger, more integrated experience than the loose coupling and stand-alone commands of the previous generation of tools.
Apache License 2.0
195 stars 192 forks source link

Run make test and upload coverage files to CodeCov #4620

Closed codegold79 closed 1 year ago

codegold79 commented 1 year ago

What this PR does / why we need it

Run make test and upload coverage files to CodeCov

Which issue(s) this PR fixes

Fixes #4619

Describe testing done for PR

I can see the capabilities controller show up in the CodeCov dashboard for this branch.

As for the featuregate controller tests, those won't show up until env tests are enabled via Build Tooling for Integrations.

Release note

Additional information

Special notes for your reviewer

codecov[bot] commented 1 year ago

Codecov Report

Merging #4620 (3b911c0) into main (bb07e03) will increase coverage by 22.40%. The diff coverage is n/a.

@@             Coverage Diff             @@
##             main    #4620       +/-   ##
===========================================
+ Coverage   49.77%   72.18%   +22.40%     
===========================================
  Files         453       18      -435     
  Lines       45424      996    -44428     
===========================================
- Hits        22612      719    -21893     
+ Misses      20652      234    -20418     
+ Partials     2160       43     -2117     

see 405 files with indirect coverage changes

codegold79 commented 1 year ago

I don't think you need a new workflow for capturing the code coverage files, you can upload the coverage reports in this workflow

Oh , good idea. Then I don't have to bring up another instance and install Go on it. Will do.

But, then again, the trigger is different for unit tests than what's in build.yaml.

Unit tests get triggered with,

on:
  pull_request:
    branches: [ main, release-* ]

But build.yaml is triggered with,

on: [pull_request]

I think I need a separate workflow. What do you think, @yharish991?

All right, after some more thinking, I think since we're building on every single pull request anyway, and producing test coverage files, it's ok to upload those files in the build.yaml workflow. The change is applied in the latest commit.