pyMBE-dev / pyMBE

pyMBE provides tools to facilitate building up molecules with complex architectures in the Molecular Dynamics software ESPResSo. For an up-to-date API documention please check our website:
https://pymbe-dev.github.io/pyMBE/pyMBE.html
GNU General Public License v3.0
6 stars 8 forks source link

Add Codecov #57

Closed jngrad closed 4 months ago

jngrad commented 4 months ago

Description of changes:

jngrad commented 4 months ago

The pyMBE.py script has 55% code coverage at the time of writing. See #58 for the features that require our attention.

If we could get every pyMBE community member to contribute unit tests for 5 features and invest no more than 20 min of developer time per unit test, we should be able to reach 90% code coverage in pyMBE.py in about a week. We don't need to write simulation scripts, just a few np.testing.assert_allclose() or pd.testing.assert_frame_equal() checks. Convenience scripts under the lib/ folder might require more effort, since they need either synthetic data or a minimal ESPResSo simulation script as input.

The report is available online. You can generate the code coverage report locally with the following commands:

make unit_tests COVERAGE=1
make coverage_html
firefox coverage/index.html

This draft PR will be rebased once all dependency issues are sorted out. It is currently designed around Codecov, because I'm already familiar with this service, but I am open to alternatives. For completeness, here are the main competing services: Codecov, Coveralls, Codacy. Here is a brief comparison of these services.

pm-blanco commented 4 months ago

@jngrad a million thanks for addressing this point. I will add this to our tomorrow's meeting schedule so we can start splitting the workload of developing the tests.

jngrad commented 4 months ago

@pm-blanco While we wait for the Pylint PR to be merged, could you please give Codecov access to the pyMBE organization? Right now I'm using my own Codecov token, which means only the commits on my fork can upload coverage reports. Here is the official quick start page. You will need to follow step 1 using your GitHub account to sign up and establish access rights (the app needs to get read access to the organization and write access to write a green check mark in the commit metadata) and step 2 to store the secret token in the pyMBE-dev/pyMBE repository settings. That's it. The YAML file described in step 2 is already available in this PR. Steps 3-6 are already done in this PR too.

pm-blanco commented 4 months ago

@jngrad I belive it should be done now!

codecov[bot] commented 4 months ago

Welcome to Codecov :tada:

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

:information_source: You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered :open_umbrella:

jngrad commented 4 months ago

The code coverage reports are now uploaded to https://app.codecov.io/gh/pyMBE-dev/pyMBE and written to the commit status (green checkmark or red cross). New features require a unit test, otherwise code coverage will drop and CI will fail.

Things to keep in mind: