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

Code coverage with github action - final #22

Merged
merged 9 commits into from
Jul 19, 2024

Conversation

caleb-sitton-inl
Copy link
Collaborator

@caleb-sitton-inl caleb-sitton-inl commented Jul 12, 2024


Pull Request Description

What issue does this change request address? (Use "#" before the issue to link it, i.e., #42.)

#23

What are the significant changes in functionality due to this change request?

The run_tests shell script has been updated with a new feature. It now accepts a command line argument specifying which tests the user would like to run (unit, integration, or both). It defaults to running all tests. This feature is particularly useful when the user wishes to check the code coverage provided by a single test type.

A code coverage script named check_py_coverage.sh has been added. This script checks code coverage for all python files within the FORCE/src directory when run_tests is executed, and it returns the results in HTML format. It passes all command line arguments on to run_tests, thus preserving the functionality of arguments supported by run_tests. It is based on a similar script of the same name in the github.com/idaholab/raven repository. A config file for coverage.py has also been added.

The run_tests.yml script in the github action has been updated to run the above mentioned check_py_coverage.sh instead of the run_tests shell script. The coverage script serves as a wrapper around run_tests, so all tests are still run, albeit with some overhead time attributable to the coverage tracking. The coverage results are specifically exported to an artifact, where details regarding coverage can be found. A "notice" annotation has been added that alerts the user of the overall coverage of the tests in a more obvious manner than the artifact. The attached message also directs the user to the coverage artifact for more detailed coverage information.


For Change Control Board: Change Request Review

The following review must be completed by an authorized member of the Change Control Board.

  • 1. Review all computer code.
  • 2. Make sure the Python code and commenting standards are respected (camelBack, etc.) - See on the wiki for details.
  • 3. Automated Tests should pass, including run_tests, pylint, and manual building tests.
  • 4. If significant functionality is added, there must be tests added to check this. Tests should cover all possible options. Multiple short tests are preferred over one large test.
  • 5. If the change modifies or adds a requirement or a requirement based test case, the Change Control Board's Chair or designee also needs to approve the change. The requirements and the requirements test shall be in sync.
  • 6. The merge request must reference an issue. If the issue is closed, the issue close checklist shall be done.

@GabrielSoto-INL GabrielSoto-INL self-requested a review July 15, 2024 18:15
Copy link
Collaborator

@GabrielSoto-INL GabrielSoto-INL left a comment

Choose a reason for hiding this comment

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

Minor changes requested, otherwise great work so far!

.github/workflows/run_tests.yml Show resolved Hide resolved
run_tests Show resolved Hide resolved
check_py_coverage.sh Outdated Show resolved Hide resolved
check_py_coverage.sh Outdated Show resolved Hide resolved
Copy link
Collaborator

@GabrielSoto-INL GabrielSoto-INL left a comment

Choose a reason for hiding this comment

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

Changes LGTM

@GabrielSoto-INL
Copy link
Collaborator

@caleb-sitton-inl would you be able to raise an issue for a code coverage feature request? I realize there is no linked issue within this PR

@GabrielSoto-INL GabrielSoto-INL added Do Not Merge This is not ready to be merged and removed Do Not Merge This is not ready to be merged labels Jul 17, 2024
@GabrielSoto-INL GabrielSoto-INL merged commit 7ffc767 into idaholab:main Jul 19, 2024
1 check passed
@caleb-sitton-inl caleb-sitton-inl deleted the code-coverage branch July 19, 2024 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants