Skip to content

Enforce branch coverage in workflow (set limit on uncovered branches) #1115

@skliper

Description

@skliper

Is your feature request related to a problem? Please describe.
#1114 gets us down to 4 uncovered branches (with issues for each), need to enforce so this doesn't slip w/ future updates.

Describe the solution you'd like
Workflow currently checks for 100% line coverage:

- name: Confirm 100% line coverage
run: |
if [[ `grep -A 3 "Overall coverage rate" lcov_out.txt | grep lines` != *"100.0%"* ]]; then
grep -A 3 "Overall coverage rate" lcov_out.txt
echo "Lacks 100.0% line unit test coverage"
exit -1
fi

Add check of branches, suggesting reading in the branches*(AAA of BBB branches) and confirming BBB-AAA <= 4 (suggesting the bash math support to keep things simple).

Describe alternatives you've considered
Minimum % coverage is somewhat weak since it doesn't really catch if you add more uncovered branches (as long as you add enough covered ones also). Hard count check is better. Really getting to 100% is even better, but we aren't there yet.

Additional context
None

Requester Info
Jacob Hageman - NASA/GSFC

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions