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

Removing SmartList & adding coverage #1992

Merged
merged 5 commits into from
Oct 31, 2024
Merged

Removing SmartList & adding coverage #1992

merged 5 commits into from
Oct 31, 2024

Conversation

john-science
Copy link
Member

@john-science john-science commented Oct 31, 2024

What is the change?

  1. Added a bunch of code coverage to textProcessors.py.
  • Moved unit tests for textProcessors.py from test_interfaces.py.
  • Removed testProcessors.py::SmartList from the API.
  1. I added --fail-under=90.

Why is the change being made?

Last night, I was trying to add code coverage to textProcessors.py, on general principles.

And I noticed two strange things:

  1. Half the test for textProcessors.py were in test_interface.py for now reason. So I moved those into textProcessors.py.
  2. The class SmartList in textProcessors.py was totally broken. I found multiple bugs in that class and it's usage while trying to write tests for it that prove it has not worked in at least four years. So, it is unused and I removed it.

Notes

  • I tested the --fail-under flag in another branch and it worked.
  • @opotowsky I was able to show that this change does not affect downstream tests (jenkins 249)

Checklist

  • The release notes have been updated if necessary.
  • The documentation is still up-to-date in the doc folder.
  • The dependencies are still up-to-date in pyproject.toml.

@john-science john-science added cleanup Code/comment cleanup: Low Priority testing Related to tests labels Oct 31, 2024
@john-science john-science marked this pull request as draft October 31, 2024 16:50
@john-science john-science marked this pull request as ready for review October 31, 2024 18:19
@@ -44,6 +44,7 @@ jobs:
mpiexec -n 2 --use-hwthread-cpus coverage run --rcfile=pyproject.toml -m pytest --cov=armi --cov-config=pyproject.toml --cov-report=lcov --cov-append --ignore=venv armi/tests/test_mpiParameters.py || true
mpiexec -n 2 --use-hwthread-cpus coverage run --rcfile=pyproject.toml -m pytest --cov=armi --cov-config=pyproject.toml --cov-report=lcov --cov-append --ignore=venv armi/tests/test_mpiDirectoryChangers.py || true
coverage combine --rcfile=pyproject.toml --keep -a
coverage report --rcfile=pyproject.toml -i --skip-empty --skip-covered --sort=cover --fail-under=90
Copy link
Member

Choose a reason for hiding this comment

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

MWAHAHAHHAHAHHAHAHA

YESSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS


def test_issueWarningOnFindingText(self):
with textProcessors.SequentialReader(self._DUMMY_FILE_NAME) as sr:
warningMsg = "Oh no"
Copy link
Member

Choose a reason for hiding this comment

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

🤣

Copy link
Member

@opotowsky opotowsky left a comment

Choose a reason for hiding this comment

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

Merge away!

image

@john-science john-science merged commit e777af7 into main Oct 31, 2024
19 checks passed
@john-science john-science deleted the code_cov_halloween branch October 31, 2024 21:27
drewj-tp added a commit that referenced this pull request Nov 7, 2024
…u-rotate-with-pin-dep

* zprince/component_flux_up:
  fix linting
  release notes
  Enabling axial expansion with detailed depletion (#1954)
  Improving error testing (#2004)
  Addressing reviewer comments for component pin mg fluxes
  Removing mystery coverage line from tests (#2003)
  beef up assertions
  resolve fixme
  org imports
  No need to recast strings to strings
  Finishing up the numProcessors -> nTasks conversion (#2002)
  Using one-block reactor for component flux test
  Supporting Python 3.13 (#1996)
  Removing SmartList & adding coverage (#1992)
  Update `copyOrWarn` and `getFileSHA1Hash` to account for directories (#1984)
  Removing broken plot (#1994)
  Adding unit tests for `CylindricalComponentsDuctHetAverageBlockCollection` (#1991)
  Allowing creation of partially heterogeneous assemblies for 1D XS model (#1949)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Code/comment cleanup: Low Priority testing Related to tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants