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

Add test for the patched RIA/ORA code #717

Merged
merged 4 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,30 @@ environment:
# the one in test_create_sibling_gitlab.py. However, there is one with
# identical name in test_create_sibling_ghlike.py, now also disabled
# because MIH does not know better
KEYWORDS: not test_gh1811 and not test_fake_gitlab and not test_dryrun
KEYWORDS: >
not test_gh1811
and not test_nested_pushclone_cycle_allplatforms
and not test_fake_gitlab
and not test_dryrun
and not test_initremote
and not test_push_url
and not test_read_access
and not test_ria_postclone_noannex
and not test_version_check_ssh
and not test_version_check
and not test_obtain_permission_ssh
and not test_obtain_permission_root
and not test_remote_layout
and not test_remote_layout_ssh
and not test_setup_store
and not test_setup_ds_in_store
and not test_initremote_basic_fileurl
and not test_initremote_basic_httpurl
and not test_initremote_basic_httpsurl
and not test_initremote_basic_sshurl
and not test_gitannex_local
and not test_gitannex_ssh
and not test_ria_postclonecfg
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
PY: 3.8
INSTALL_SYSPKGS:
Expand Down Expand Up @@ -369,7 +392,7 @@ for:
# run tests on installed module, not source tree files
- cmd: md __testhome__
- cmd: cd __testhome__
# run test selecion (--traverse-namespace needed from Python 3.8 onwards)
# run test selection
- cmd: python -m pytest -s -v --durations 20 -m "not (turtle)" -k "%KEYWORDS%" --cov=datalad_next --cov-config=..\.coveragerc --pyargs %DTS%

after_test:
Expand Down
2 changes: 1 addition & 1 deletion datalad_next/patches/enabled.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
test_keyring,
customremotes_main,
create_sibling_gitlab,
patch_ria_ora,
run,
update,
# the following two patches have been taken verbatim from datalad-ria
ssh_exec,
sshconnector,
patch_ria_ora,
)
10 changes: 0 additions & 10 deletions datalad_next/patches/patch_ria_ora.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ class :class:`SSHRemoteIO`.

2. Improve ORA/RIA-related code so that it also works on Windows.
"""
from os import environ

from . import (
add_method_url2transport_path,
Expand All @@ -16,15 +15,6 @@ class :class:`SSHRemoteIO`.
# The following patches add Windows-support to ORA/RIA code
ria_utils,
replace_ora_remote,
)

# we only want to import the patches for the tests when actually running
# under pytest. this prevents inflating the runtime dependency with
# test-only dependencies -- which would be needed for the necessary imports
if environ.get("PYTEST_VERSION"):
from . import fix_ria_ora_tests

from . import (
# `replace_create_sibling_ria` be imported after `replace_sshremoteio`
# and `ria_utils`.
replace_create_sibling_ria,
Expand Down
19 changes: 19 additions & 0 deletions datalad_next/patches/replace_create_sibling_ria.py
Original file line number Diff line number Diff line change
Expand Up @@ -817,9 +817,28 @@ def _create_sibling_ria(
)


# Replace `create_sibling_ria`-method in `Dataset`. This is necessary on
# Windows. I don't know why.
def _adaptor_create_sibling_ria(self, *args, **kwargs):
return CreateSiblingRia.__call__(
*args,
**{
**kwargs,
'dataset': self,
}
)
apply_patch(
'datalad.distribution.dataset',
'Dataset',
'create_sibling_ria',
_adaptor_create_sibling_ria,
)


class UnknownLayoutVersion(Exception):
pass


known_versions_objt = ['1', '2']
# Dataset tree versions we introduced so far. This is about the layout of
# datasets in a RIA store
Expand Down
Loading