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

Improve test coverage #48

Open
2 of 5 tasks
elichad opened this issue Jan 14, 2022 · 3 comments
Open
2 of 5 tasks

Improve test coverage #48

elichad opened this issue Jan 14, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@elichad
Copy link
Collaborator

elichad commented Jan 14, 2022

Broad improvements needed to coverage:

  • Unit tests
  • Integration tests
  • Include Windows in CI

Specific improvements to existing tests:

  • use TestCase.assertRaises with a specific exception type/message instead of catching/printing all Exceptions
  • Split existing tests into smaller units
@elichad
Copy link
Collaborator Author

elichad commented Mar 31, 2022

use TestCase.assertRaises with a specific exception type/message instead of catching/printing all Exceptions

@elichad
Copy link
Collaborator Author

elichad commented Mar 31, 2022

Split existing tests into smaller units

@elichad elichad added the enhancement New feature or request label Apr 20, 2022
@patrick-austin patrick-austin self-assigned this Apr 12, 2023
patrick-austin added a commit that referenced this issue Apr 17, 2023
patrick-austin added a commit that referenced this issue Jun 9, 2023
@patrick-austin
Copy link
Contributor

Updating with WIP information from #83

Notable uncovered areas

In addition to numerous exceptions and minor branches that are not covered (i.e. raising an exception if a file that should always be present is missing), the following areas have functional code that is currently untested but could be:

  • io/uep.py from the coverage looks like second half of run() is never reached - also complicated by the fact this is being used to mock the calc attribute for ASE atoms, needs further analysis, see also Risk of infinite recursion in UEPCalculator.read #90
  • quantum/vibrational/average.py "montecarlo" branch, dftb_pbc branch, castep branch...
  • schemas.py some validations not tested

DFTB tests don't run, as _RUN_DFTB is hardcoded False. Haven't looked into this too much yet. Don't know if it's more feasible to try and install DFTB+ on the GHA runners or try and increase coverage by unit testing the following (currently uncovered) functions:

  • io/output.py:write_phonon_reports
  • quantum/main.py:asephonons_entry
  • quantum/vibrational/phonons.py:ase_phonons_calc

The following files have no coverage, and are not called anywhere else in the codebase. Could write tests for them, but is it worth it for code that is never used? May have value as library functions but it's not obvious to me if they do.

Following discussion with @leandro-liborio will keep the following:

  • calculate/uep/charged.py:ChargeDistrubution.Hfine
  • dipolar/field.py

And remove the following:

  • io/output.py:write_tensors
  • quantum/grid.py
  • quantum/reports.py
  • utils.py:create_plane_grid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants