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

Doctests do not remove built files if they fail #3389 #3655

Merged
merged 5 commits into from
Jan 3, 2024

Conversation

shubhambhar007
Copy link
Contributor

@shubhambhar007 shubhambhar007 commented Dec 23, 2023

Description

As pointed by @agriyakhetarpal , in case of failure of doctests, built files (inside the docs/build/ folder) are not deleted.
We also have to ensure deletion in case of successful doctests. I added a finally block for the same and put the subprocess call in a try block.

Fixes #3389

Type of change

Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s. If necessary, also add to the list of breaking changes.

  • [❌ ] New feature (non-breaking change which adds functionality)
  • [❌] Optimization (back-end change that speeds up the code)
  • [✅] Bug fix (non-breaking change which fixes an issue)

Key checklist:

  • [✅ ] No style issues: $ pre-commit run (or $ nox -s pre-commit) (see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code)
  • [✅] All tests pass: $ python run-tests.py --all (or $ nox -s tests)
  • [✅] The documentation builds: $ python run-tests.py --doctest (or $ nox -s doctests)

You can run integration tests, unit tests, and doctests together at once, using $ python run-tests.py --quick (or $ nox -s quick).

Further checks:

  • [✅] Code is commented, particularly in hard-to-understand areas
  • [NA ] Tests added that prove fix is effective or that feature works

@shubhambhar007
Copy link
Contributor Author

image image

Copy link
Member

@agriyakhetarpal agriyakhetarpal left a comment

Choose a reason for hiding this comment

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

Thanks for the fix, @shubhambhar007! Looks good, one small suggestion.

run-tests.py Outdated Show resolved Hide resolved
@shubhambhar007
Copy link
Contributor Author

shubhambhar007 commented Dec 23, 2023

@agriyakhetarpal i think i force pushed on top of your commit , didnt check the thread😅
Please review once .

Copy link

codecov bot commented Dec 23, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c24383c) 99.59% compared to head (4fe3e00) 99.59%.
Report is 12 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3655   +/-   ##
========================================
  Coverage    99.59%   99.59%           
========================================
  Files          258      258           
  Lines        20797    20798    +1     
========================================
+ Hits         20712    20713    +1     
  Misses          85       85           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@agriyakhetarpal
Copy link
Member

agriyakhetarpal commented Dec 23, 2023

I think it was the same suggestion that I updated your branch with, we should be fine – thanks! Looks like the missing coverage is unrelated.

@shubhambhar007
Copy link
Contributor Author

I think it was the same suggestion that I updated your branch with, we should be fine – thanks! Looks like the missing coverage is unrelated.

Yes ,i thought so too, the subrpocess call is being fed arguments by us itself and is not subject to any outside code injection, should be fine in my opinion :D .
Thanks!

Copy link
Member

@arjxn-py arjxn-py left a comment

Choose a reason for hiding this comment

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

Looks Good, thanks @shubhambhar007

@arjxn-py
Copy link
Member

Example notebook tests failing doesn't look like a cause of this PR, should we re-run jobs?

@agriyakhetarpal
Copy link
Member

Example notebook tests failing doesn't look like a cause of this PR, should we re-run jobs?

I did so just now, it seems that #3492 broke something even though it shouldn't have

@kratman kratman merged commit 3bd05c4 into pybamm-team:develop Jan 3, 2024
39 of 41 checks passed
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.

Doctests do not remove built files if they fail
4 participants