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 #14

Merged
merged 41 commits into from
May 4, 2022
Merged

Improve test coverage #14

merged 41 commits into from
May 4, 2022

Conversation

sduquemesa
Copy link
Contributor

@sduquemesa sduquemesa commented Apr 12, 2022

Context for changes

Bringing pytest/Codecov score to %95+

Example usage and tests

  • Not Applicable

Performance results justifying changes

  • Not Applicable

Workflow actions and tests

  • Not Applicable

Expected benefits and drawbacks

Expected benefits:

  • Improved test coverage of the codebase.

Possible drawbacks:

  • None.

Related Github issues

  • Not Applicable

Checklist and integration statements

  • My Python and C++ codes follow the coding and commenting styles of this project as indicated by existing files. Specifically, the changes conform to given black, docformatter and pylint configurations.
  • I have performed a self-review of these changes. I have checked my code and corrected misspellings to the best of my capacity. I have checked the CodeFactor score in the active branch and ensured it is B- or higher. I also confirm that I have already merged other branches into this branch as required.
  • I have added context for corresponding changes in documentation and README.md as needed.
  • I have added new workflow CI tests for corresponding changes and these pass locally for me.
  • I have updated _version.py based on semantic versioning. I recognize that the developers may create a Special Release including my changes.

@sduquemesa sduquemesa changed the title improve test coverage [WIP] improve test coverage Apr 12, 2022
- refactor `simulations.py` so that setup logic is on its own function (instead of the `__main__` scope) and can be tested
-  test the generated output has the expected header and number of columns
@codecov
Copy link

codecov bot commented Apr 12, 2022

Codecov Report

Merging #14 (669342a) into main (61c9dcc) will increase coverage by 1.80%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #14      +/-   ##
==========================================
+ Coverage   94.05%   95.86%   +1.80%     
==========================================
  Files          32       32              
  Lines        1835     1838       +3     
==========================================
+ Hits         1726     1762      +36     
+ Misses        109       76      -33     
Impacted Files Coverage Δ
flamingpy/__init__.py 100.00% <ø> (ø)
flamingpy/benchmarks/decoding.py 100.00% <ø> (ø)
flamingpy/benchmarks/lemon.py 100.00% <ø> (ø)
flamingpy/benchmarks/matching.py 100.00% <ø> (ø)
flamingpy/benchmarks/shortest_path.py 100.00% <ø> (ø)
flamingpy/decoders/mwpm/lemon.py 100.00% <ø> (ø)
flamingpy/_version.py 100.00% <100.00%> (ø)
flamingpy/benchmarks/simulations.py 100.00% <100.00%> (+14.49%) ⬆️
flamingpy/examples/decoding.py 100.00% <100.00%> (+12.50%) ⬆️
flamingpy/examples/surface_code.py 100.00% <100.00%> (+24.13%) ⬆️
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 61c9dcc...669342a. Read the comment docs.

@sduquemesa sduquemesa changed the title [WIP] improve test coverage Improve test coverage Apr 13, 2022
@sduquemesa sduquemesa self-assigned this Apr 13, 2022
@sduquemesa sduquemesa added the workflow & tests CI tests have been modified and/or new workflows were added label Apr 13, 2022
@sduquemesa sduquemesa marked this pull request as ready for review April 14, 2022 14:30
Copy link
Collaborator

@ilan-tz ilan-tz left a comment

Choose a reason for hiding this comment

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

Nicely done on bringing the test coverage score up! I left a few comments and questions -- one of them was regarding modifying the test_benchmarks_examples by importing functions rather than simply importing the modules to see if they run:

What was the issue behind this approach? Is it that the codecov score becomes too low? In which case: is it preferable to create functions out of the examples and benchmarks (as you have) or simply to tell codecov to ignore the examples and benchmarks files (we do test them but only with import statements to see if they run - all the other functionality is tested in other places).

I'd please like your take on this before you get to the others!

tests/unit/test_init.py Outdated Show resolved Hide resolved
tests/unit/test_iid_noise.py Outdated Show resolved Hide resolved
tests/unit/test_graphstates.py Outdated Show resolved Hide resolved
tests/unit/test_graphstates.py Outdated Show resolved Hide resolved
tests/unit/test_graphstates.py Show resolved Hide resolved
tests/unit/test_simulations.py Outdated Show resolved Hide resolved
tests/unit/test_simulations.py Outdated Show resolved Hide resolved
tests/unit/test_simulations.py Outdated Show resolved Hide resolved
flamingpy/simulations.py Outdated Show resolved Hide resolved
flamingpy/simulations.py Outdated Show resolved Hide resolved
@sduquemesa sduquemesa requested a review from ilan-tz April 21, 2022 18:49
@ilan-tz ilan-tz changed the base branch from main to special-release April 28, 2022 15:40
Copy link
Collaborator

@ilan-tz ilan-tz left a comment

Choose a reason for hiding this comment

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

Nice - just a couple of small comments, and then we can merge.

tests/unit/test_graphstates.py Outdated Show resolved Hide resolved
tests/unit/test_benchmarks_examples.py Show resolved Hide resolved
flamingpy/examples/decoding.py Outdated Show resolved Hide resolved
@sduquemesa sduquemesa requested a review from ilan-tz April 29, 2022 17:41
@ilan-tz ilan-tz changed the base branch from special-release to main April 30, 2022 16:17
@sduquemesa sduquemesa requested a review from ilan-tz May 3, 2022 16:01
@ilan-tz ilan-tz merged commit 31c2fb9 into main May 4, 2022
@ilan-tz ilan-tz deleted the improve-test-coverage branch May 4, 2022 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
workflow & tests CI tests have been modified and/or new workflows were added
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants