From 76e4d8ba1393356710afe57211c64c66b8ec10b6 Mon Sep 17 00:00:00 2001 From: Christian Monch Date: Thu, 24 Oct 2024 07:05:19 +0200 Subject: [PATCH] ci: deactivate tests under Windows Due to incompatibilities ofi `git-annex` with `git-worktree` on Windows a number of tests are skipped on Windows --- datalad_remake/annexremotes/tests/test_hierarchies.py | 2 ++ datalad_remake/annexremotes/tests/test_remake_remote.py | 2 ++ datalad_remake/commands/tests/test_collection.py | 3 +++ datalad_remake/commands/tests/test_compute.py | 3 +++ datalad_remake/commands/tests/test_provision.py | 6 ++++++ 5 files changed, 16 insertions(+) diff --git a/datalad_remake/annexremotes/tests/test_hierarchies.py b/datalad_remake/annexremotes/tests/test_hierarchies.py index 74c4a16..3cba4b5 100644 --- a/datalad_remake/annexremotes/tests/test_hierarchies.py +++ b/datalad_remake/annexremotes/tests/test_hierarchies.py @@ -4,6 +4,7 @@ import pytest from datalad.distribution.get import Get as datalad_Get from datalad_next.datasets import Dataset +from datalad_next.tests import skip_if_on_windows from datalad_remake.commands.tests.create_datasets import ( create_simple_computation_dataset, @@ -74,6 +75,7 @@ def _check_content(dataset, file_content: Iterable[tuple[str, str]]): assert (dataset.pathobj / file).read_text() == content +@skip_if_on_windows @pytest.mark.parametrize('output_pattern', [output_pattern_static, output_pattern_glob]) def test_end_to_end(tmp_path, monkeypatch, output_pattern): root_dataset = create_simple_computation_dataset(tmp_path, 'd2', 3, test_method) diff --git a/datalad_remake/annexremotes/tests/test_remake_remote.py b/datalad_remake/annexremotes/tests/test_remake_remote.py index 29c4641..9833754 100644 --- a/datalad_remake/annexremotes/tests/test_remake_remote.py +++ b/datalad_remake/annexremotes/tests/test_remake_remote.py @@ -4,6 +4,7 @@ from typing import cast from annexremote import Master +from datalad_next.tests import skip_if_on_windows from datalad_remake.commands.tests.create_datasets import create_ds_hierarchy @@ -62,6 +63,7 @@ def send(self, value): self.input.put(value) +@skip_if_on_windows def test_compute_remote_main(tmp_path, monkeypatch): dataset = create_ds_hierarchy(tmp_path, 'ds1', 0)[0][2] monkeypatch.chdir(dataset.path) diff --git a/datalad_remake/commands/tests/test_collection.py b/datalad_remake/commands/tests/test_collection.py index e0c1590..743180d 100644 --- a/datalad_remake/commands/tests/test_collection.py +++ b/datalad_remake/commands/tests/test_collection.py @@ -1,10 +1,13 @@ from pathlib import Path +from datalad_next.tests import skip_if_on_windows + from ..make_cmd import collect from .create_datasets import create_ds_hierarchy from .test_provision import get_file_list +@skip_if_on_windows def test_collect(tmp_path): dataset = create_ds_hierarchy(tmp_path, 'ds1', 1)[0][2] diff --git a/datalad_remake/commands/tests/test_compute.py b/datalad_remake/commands/tests/test_compute.py index b4eac2c..391b7e5 100644 --- a/datalad_remake/commands/tests/test_compute.py +++ b/datalad_remake/commands/tests/test_compute.py @@ -1,4 +1,5 @@ from datalad_next.datasets import Dataset +from datalad_next.tests import skip_if_on_windows from datalad_remake.commands.tests.create_datasets import ( create_simple_computation_dataset, @@ -13,6 +14,7 @@ output_pattern = ['a.txt'] +@skip_if_on_windows def test_duplicated_computation(tmp_path): root_dataset = create_simple_computation_dataset(tmp_path, 'ds1', 0, test_method) @@ -21,6 +23,7 @@ def test_duplicated_computation(tmp_path): _run_simple_computation(root_dataset) +@skip_if_on_windows def test_speculative_computation(tmp_path, datalad_cfg): root_dataset = create_simple_computation_dataset(tmp_path, 'ds1', 0, test_method) diff --git a/datalad_remake/commands/tests/test_provision.py b/datalad_remake/commands/tests/test_provision.py index 3fcb8f7..ca8c86f 100644 --- a/datalad_remake/commands/tests/test_provision.py +++ b/datalad_remake/commands/tests/test_provision.py @@ -7,6 +7,7 @@ from datalad_next.datasets import Dataset from datalad_next.runners import call_git_lines +from datalad_next.tests import skip_if_on_windows from ..make_cmd import provide_context from .create_datasets import create_ds_hierarchy @@ -31,6 +32,7 @@ b_paths = [path.format(file='b') for path in file_path_templates] +@skip_if_on_windows def test_worktree_basic(tmp_path): dataset = create_ds_hierarchy(tmp_path, 'ds1', 3)[0][2] inputs = [ @@ -67,6 +69,7 @@ def check_deleted_worktrees(ds: Dataset): ) +@skip_if_on_windows def test_worktree_globbing(tmp_path): dataset = create_ds_hierarchy(tmp_path, 'ds1', 3)[0][2] result = dataset.provision( @@ -119,6 +122,7 @@ def get_file_list( yield str((prefix / child).relative_to(root)) +@skip_if_on_windows def test_provision_context(tmp_path): dataset = create_ds_hierarchy(tmp_path, 'ds1')[0][2] with provide_context(dataset, branch=None, input_patterns=['**']) as worktree: @@ -157,6 +161,7 @@ def test_unclean_dataset(tmp_path): ) +@skip_if_on_windows def test_branch_deletion_after_provision(tmp_path): dataset = create_ds_hierarchy(tmp_path, 'ds1', 3)[0][2] with provide_context( @@ -169,6 +174,7 @@ def test_branch_deletion_after_provision(tmp_path): assert worktree.name not in branches +@skip_if_on_windows def test_not_present_local_datasets(tmp_path): root_ds = Dataset(tmp_path / 'ds1') root_ds.create(cfg_proc='text2git', result_renderer='disabled')