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

PR: testsuite/platform.py conversion to pytest + remove BaseTestCase #7743

Merged
merged 3 commits into from
Jul 28, 2023

Conversation

bigtedde
Copy link
Contributor

@bigtedde bigtedde commented Jul 27, 2023

This is one of the last remaining files in the test suite to have quite a bit of unittest and BaseTestCase usages, so I split it into its own PR. Will convert all unittest to pytest, remove BaseTestCase entirely, and rename some tests to follow the naming conventions of the classes they are being pull from.

@codecov-commenter
Copy link

codecov-commenter commented Jul 27, 2023

Codecov Report

Merging #7743 (8eed958) into master (f33efc0) will increase coverage by 0.01%.
The diff coverage is n/a.

❗ 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    #7743      +/-   ##
==========================================
+ Coverage   83.65%   83.67%   +0.01%     
==========================================
  Files          66       66              
  Lines       11915    11915              
  Branches     2159     2159              
==========================================
+ Hits         9968     9970       +2     
+ Misses       1371     1370       -1     
+ Partials      576      575       -1     

see 1 file with indirect coverage changes

@bigtedde
Copy link
Contributor Author

All checks passed, same test coverage before and after. Unittest removed as well as BaseTestCase. Marking as ready for review 👍

@bigtedde bigtedde marked this pull request as ready for review July 27, 2023 20:14
Copy link
Member

@ThomasWaldmann ThomasWaldmann left a comment

Choose a reason for hiding this comment

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

Hmm, now that the test class is gone that functioned as container per platform, you needed to put the platform name in all the function names.

Maybe it would be good to split this into multiple modules for linux, darwin, posix.

src/borg/testsuite/platform.py Outdated Show resolved Hide resolved
@bigtedde
Copy link
Contributor Author

Maybe it would be good to split this into multiple modules for linux, darwin, posix.

Split into three modules: platform_linux.py, platform_darwin.py, platform_posix.py?

Copy link
Member

@ThomasWaldmann ThomasWaldmann left a comment

Choose a reason for hiding this comment

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

LGTM.

One thing I noticed: we have freebsd platform code, but no freebsd acl tests.
Implementing them would be out of scope of this PR of course, but maybe you could create some sort of dummy platform_freebsd.py test file that has some skipped tests due to "not implemented".

After you have created the dummy file, please add a comment to #7745.

@bigtedde
Copy link
Contributor Author

One thing I noticed: we have freebsd platform code, but no freebsd acl tests. Implementing them would be out of scope of this PR of course, but maybe you could create some sort of dummy platform_freebsd.py test file that has some skipped tests due to "not implemented".

After you have created the dummy file, please add a comment to #7745.

Okay, I can do that. I will create a separate PR for that one.

@bigtedde
Copy link
Contributor Author

LGTM.

Excelent! I have marked this as ready for review. Please let me know if there is anything you would like changed in this PR before merging.

@ThomasWaldmann ThomasWaldmann merged commit 5df49ee into borgbackup:master Jul 28, 2023
11 checks passed
@bigtedde bigtedde deleted the platform-pytest branch July 28, 2023 19:36
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.

3 participants