-
-
Notifications
You must be signed in to change notification settings - Fork 741
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
Repo tests - conversion to pytest #7626
Conversation
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## master #7626 +/- ##
==========================================
- Coverage 83.85% 83.76% -0.09%
==========================================
Files 66 66
Lines 11864 11900 +36
Branches 2149 2155 +6
==========================================
+ Hits 9948 9968 +20
- Misses 1346 1359 +13
- Partials 570 573 +3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you delete the old tests which these tests replace?
Please rebase on current master. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
guess that fixture/contextmanager combination is problematic.
src/borg/testsuite/repository.py
Outdated
def test_basic_operations(fixture, request): | ||
repo = request.getfixturevalue(fixture) | ||
with repo as repository: | ||
@pytest.mark.parametrize("fixture", [pytest.lazy_fixture("repository"), pytest.lazy_fixture("remote_repository")]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works, however when discussing with @m3nu we were skeptical about including this as it seems like a small project that could be compromised: https://github.com/TvoroG/pytest-lazy-fixture
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or abandoned and unmaintained, which sadly happens too often for useful packages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That lazy-fixture project doesn't look like regularly maintained. Last release 3.5y old.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please review these "corruption tests" concerning the correct opening, reopening, closing of the repo, where a commit/rollback happens, that stuff that does not need to be within the repo context is happening outside the repo context.
I am reviewing this now, and will have this taken care of by end of day 👍 |
Hmmm. Windows test didn't pass -
It provides assertion error that looks similar to one encountered the other day (something to do with a Location object, iirc)
I looked through the test_spare_file test and couldn't find anything that would have broken from my changes 🤔. Will keep my eyes peeled. |
Made some minor clean up changes today, and after a new commit they got past the spurious Windows tests error. @ThomasWaldmann I am feeling really good about where we are with this test conversion. Do you have any areas of concern I could address before marking this PR ready for review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, last review, will merge after final fixes.
squash all commits together and keep what looks valuable from all the commit comments? |
Thanks! |
The current repository tests are written with the unittest framework. I have began converting these to pytest, starting with just a few tests so as to make sure I am on the right track with these changes.
Very rough draft, started in a separate test file for now. If I am on the right track I will merge changes into original test file and continue converting.