-
Notifications
You must be signed in to change notification settings - Fork 208
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
Transport
: feat compress
& extract
methods
#6743
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6743 +/- ##
==========================================
+ Coverage 78.13% 78.16% +0.04%
==========================================
Files 564 564
Lines 42526 42627 +101
==========================================
+ Hits 33222 33316 +94
- Misses 9304 9311 +7 ☔ View full report in Codecov by Sentry. |
tests/transports/test_all_plugins.py
Outdated
) | ||
|
||
# if creating the tar file fails | ||
# I do this by monkey patching transport.exec_command_wait_async |
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 explain by this monkey patching results in an error? There are multiple reasons for an OSError
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.
It raises, because the exit code is mocked to 1
instead of 0
.
Ok I added match=
for all with pytest.raises(OSError,
cases.
@agoscinski thanks a lot, your review is applied, now. |
28300c7
to
a8bac9a
Compare
tests/transports/test_all_plugins.py
Outdated
def test_compress_glob( | ||
custom_transport, create_file_hierarchy, file_hierarchy, format, tmp_path_remote, tmp_path_local | ||
): | ||
"""Test the glob functionality of the compress method. |
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.
"""Test the glob functionality of the compress method. | |
"""Test the glob functionality of the compress method. | |
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.
done
tests/transports/test_all_plugins.py
Outdated
], | ||
) | ||
def test_compress_glob( | ||
custom_transport, create_file_hierarchy, file_hierarchy, format, tmp_path_remote, tmp_path_local |
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.
if not too much work, could you add typehints for readability? Its hard enough to find the fixtures if one does not know
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, I added type hints. Note we can only put the return type of those fixtures there.
def test_compress_glob(
custom_transport: Transport,
create_file_hierarchy: callable,
file_hierarchy: dict,
format: str,
tmp_path_remote: Path,
tmp_path_local: Path
) -> None:
tests/transports/test_all_plugins.py
Outdated
It's similar to ``test_compress_basic`` but specifies a glob pattern for the source. | ||
Since we had to solve several issues with the glob pattern, I found it appropriate to test it separately. | ||
By isolation we can debug faster in case of a future problem.""" |
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.
It's similar to ``test_compress_basic`` but specifies a glob pattern for the source. | |
Since we had to solve several issues with the glob pattern, I found it appropriate to test it separately. | |
By isolation we can debug faster in case of a future problem.""" | |
It is similar to :func:`test_compress_basic` but specifies a glob pattern for the remote source allowing us to test | |
the resolving mechanism separately. | |
""" |
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.
done
tests/transports/test_all_plugins.py
Outdated
"""Mock the remote tmp path using tmp_path_factory to create folder start with prefix 'remote' | ||
remote prefix was used for clarification, | ||
if in future we decided to run these tests against an actual remote machine instead of `localhost`. | ||
""" |
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.
I think the reason is not that we want to run it in the future on remote. I think it is to have two separate tmp path's, one to imitate local, and one to imitate remote. See for example test_put_get_empty_string_tree
that uses both fixtures.
"""Mock the remote tmp path using tmp_path_factory to create folder start with prefix 'remote' | |
remote prefix was used for clarification, | |
if in future we decided to run these tests against an actual remote machine instead of `localhost`. | |
""" | |
"""Provides a tmp path for mocking local and remote computer directory environment. | |
Local and remote directories must be kept separate to ensure proper functionality testing. | |
""" |
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.
yeah sure. But also in case you ever want to run this against a remote server, it's easier this way.
Since ideally one would only need to update that tmp_path_remote
to point to somewhere on remote.
RTD failing is unrelated to this PR:
Update: their server was down, now it works again. |
Introduce two new methods
compress
&extract
for transport plugins.This is essential for the upcoming developments on stashing features. More details described on issue #6740