Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1115, Add absolute branch coverage check #1117

Merged

Conversation

nmullane
Copy link
Contributor

@nmullane nmullane commented Jul 26, 2021

Check for absolute number of missed branches in GitHub workflow instead of checking a percentage branch coverage.

Ensure that the number of missed branches does not increase from the current 4 missed branches.

Describe the contribution
Fixes #1115. The PR #1114 that is currently in the integration candidate branch has only 4 missed branches in the unit tests. This PR checks that the number of missed branches is <= 4 instead of checking the percentage branch coverage. This puts an absolute limit on the number of missed branches.

Testing performed
Steps taken to test the contribution:

  1. The local_unit_test workflow will currently fail on any branch that is not the current integration candidate, so I merged this PR into my fork's integration candidate branch to see it pass here.
  2. The error output when the coverage is not high enough can be seen here

Expected behavior changes
A clear and concise description of how this contribution will change behavior and level of impact.

  • This PR will only change the behavior of the local_unit_test GitHub Actions workflow and will fail the test if more than 4 branches are not covered by the unit tests.

System(s) tested on

  • GitHub Actions Runner

Contributor Info - All information REQUIRED for consideration of pull request
Niall Mullane - GSFC 582 Intern

Copy link
Contributor

@skliper skliper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, could you leave in the 100% check for line coverage since it's still a criteria we want to check. Just add the absolute branch coverage check.

@nmullane
Copy link
Contributor Author

This added absolute branch coverage check should now be passing in Github Actions since #1114 has now been merged.

@astrogeco astrogeco added the CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) label Aug 3, 2021
Check for absolute number of missed branches in github workflow instead
of checking a percentage.

Ensure that the number of missed branches does not increase from the
current 4 missed branches.
@astrogeco astrogeco added CCB:Approved Indicates code review and approval by community CCB and removed CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) labels Aug 4, 2021
@astrogeco
Copy link
Contributor

CCB:2021-08-04 APPROVED

@astrogeco astrogeco changed the base branch from main to integration-candidate August 6, 2021 22:44
@astrogeco astrogeco merged commit 9f7ebaa into nasa:integration-candidate Aug 6, 2021
astrogeco added a commit to nasa/cFS that referenced this pull request Aug 6, 2021
nasa/osal#1127 osal-IC

- nasa/osal#1117, Add absolute branch coverage check
astrogeco added a commit to nasa/cFS that referenced this pull request Aug 11, 2021
**Combines**

- nasa/cFE#1772, v6.8.0-rc1+dev844
- nasa/osal#1127, v5.1.0-rc1+dev590

**Includes**

*cFE*

- nasa/cFE#1737, Move global count into test global struct.
- nasa/cFE#1722, Add ES application control API functional tests
- nasa/cFE#1743, Update coverage test to use UtAssert macros
- nasa/cFE#1734, Add table api functional tests
- nasa/cFE#1753, Add Generic Counter API test
- nasa/cFE#1766, finish ES misc API functional test
- nasa/cFE#1764, last char truncated in coverage log output
- nasa/cFE#1728, Mistakes in some copyright headers
- nasa/cFE#1767, Add misc time api functional test cFE
- nasa/cFE#1749, Add Functional Test for EVS Reset Filters API
- nasa/cFE#1781, RTEMS CFE_FT_Global build failure
- nasa/cFE#1796, replace VOIDCALL assert macro

*osal*

- nasa/osal#1117, Add absolute branch coverage check
astrogeco added a commit to nasa/cFS that referenced this pull request Aug 11, 2021
**Combines**

- nasa/cFE#1772, v6.8.0-rc1+dev844
- nasa/osal#1127, v5.1.0-rc1+dev590

**Includes**

*cFE*

- nasa/cFE#1737, Move global count into test global struct.
- nasa/cFE#1722, Add ES application control API functional tests
- nasa/cFE#1743, Update coverage test to use UtAssert macros
- nasa/cFE#1734, Add table api functional tests
- nasa/cFE#1753, Add Generic Counter API test
- nasa/cFE#1766, finish ES misc API functional test
- nasa/cFE#1764, last char truncated in coverage log output
- nasa/cFE#1728, Mistakes in some copyright headers
- nasa/cFE#1767, Add misc time api functional test cFE
- nasa/cFE#1749, Add Functional Test for EVS Reset Filters API
- nasa/cFE#1781, RTEMS CFE_FT_Global build failure
- nasa/cFE#1796, replace VOIDCALL assert macro

*osal*

- nasa/osal#1117, Add absolute branch coverage check

Co-authored-by: Joseph Hickey <jphickey@users.noreply.github.com>
Co-authored-by: Alex Campbell <zanzaben@users.noreply.github.com>
Co-authored-by: Niall Mullane <nmullane@users.noreply.github.com>
Co-authored-by: Paul <pavll@users.noreply.github.com>
@skliper skliper added this to the 6.0.0 milestone Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CCB:Approved Indicates code review and approval by community CCB
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enforce branch coverage in workflow (set limit on uncovered branches)
3 participants