[go: nahoru, domu]

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

Refactor tests #58

Merged
merged 11 commits into from
May 8, 2018
Merged

Refactor tests #58

merged 11 commits into from
May 8, 2018

Conversation

mimischi
Copy link
Contributor
@mimischi mimischi commented Apr 8, 2018

Changes made in this pull request:

  • Refactored tests. Got rid of duplicate code, added @pytest.mark.parametrize where applicable.

PR Checklist

  • Added changelog fragment in ./changelog/ (more information)?
  • [ ] Issue raised/referenced?

@mimischi
Copy link
Contributor Author
mimischi commented Apr 8, 2018

I would still like to go and refactor the tests found in mdbenchmark/tests/test_generate.py. I think those integration tests are extremely annoying to maintain and even harder to read.

I'd propose to do proper unit tests where applicable, and mock needed output inside of test_generate.py, such that we only end up testing the actual code that is in generate.py and not the utility functions.

@codecov
Copy link
codecov bot commented Apr 8, 2018

Codecov Report

Merging #58 into master will increase coverage by 1.2%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master      #58     +/-   ##
=========================================
+ Coverage   89.13%   90.33%   +1.2%     
=========================================
  Files          12       12             
  Lines         506      507      +1     
=========================================
+ Hits          451      458      +7     
+ Misses         55       49      -6
Impacted Files Coverage Δ
mdbenchmark/generate.py 100% <100%> (ø) ⬆️
mdbenchmark/mdengines/gromacs.py 100% <100%> (ø) ⬆️
mdbenchmark/cli.py 100% <100%> (+23.07%) ⬆️
mdbenchmark/mdengines/namd.py 100% <100%> (+2.38%) ⬆️
mdbenchmark/utils.py 100% <0%> (+1.75%) ⬆️
mdbenchmark/submit.py 100% <0%> (+2.32%) ⬆️

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 4007b64...06b40fd. Read the comment docs.

@mimischi
Copy link
Contributor Author
mimischi commented Apr 9, 2018

The changes from 9fcdbac can still be optimized. Nonetheless, dividing the extremely bulky test_generate into separate functions is way better.

@mimischi
Copy link
Contributor Author

Whoop whoop. Got the coverage up to 90% now. I'll check in the morning if I find any obvious mistakes.

@mimischi mimischi changed the title [WIP] Refactor tests Refactor tests Apr 26, 2018
@mimischi mimischi force-pushed the refactor_tests branch 3 times, most recently from d96133a to 593501d Compare April 27, 2018 11:17
@mimischi
Copy link
Contributor Author

This should be ready for a review @MSiggel @kain88-de.

@mimischi mimischi force-pushed the refactor_tests branch 3 times, most recently from e403a0f to dcf8912 Compare April 27, 2018 11:50
@mimischi mimischi merged commit 2caa3bd into master May 8, 2018
@mimischi mimischi deleted the refactor_tests branch May 8, 2018 08:56
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.

None yet

1 participant