Skip to content

Commit d7a35b9

Browse files
authored
gha: enable hdfs tests (#4644)
1 parent ab22118 commit d7a35b9

File tree

7 files changed

+26
-84
lines changed

7 files changed

+26
-84
lines changed

tests/func/test_add.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,9 @@ def test_add_file_in_dir(tmp_dir, dvc):
208208
),
209209
(pytest.lazy_fixture("gs"), "md5", "8c7dd922ad47494fc02c388e12c00eac"),
210210
(
211-
pytest.param(
212-
pytest.lazy_fixture("hdfs"),
213-
"checksum",
214-
"000002000000000000000000a86fe4d846edc1bf4c355cb6112f141e",
215-
marks=pytest.mark.xfail(
216-
reason="https://github.com/iterative/dvc/issues/4418"
217-
),
218-
)
211+
pytest.lazy_fixture("hdfs"),
212+
"checksum",
213+
"000002000000000000000000a86fe4d846edc1bf4c355cb6112f141e",
219214
),
220215
],
221216
indirect=["workspace"],

tests/func/test_api.py

Lines changed: 14 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,8 @@
99
from dvc.utils.fs import remove
1010
from tests.unit.tree.test_repo import make_subrepo
1111

12-
cloud_names = [
13-
"s3",
14-
"gs",
15-
"azure",
16-
"gdrive",
17-
"oss",
18-
"ssh",
19-
"http",
20-
]
21-
clouds = [pytest.lazy_fixture(cloud) for cloud in cloud_names] + [
22-
pytest.param(
23-
pytest.lazy_fixture("hdfs"),
24-
marks=pytest.mark.xfail(
25-
reason="https://github.com/iterative/dvc/issues/4418"
26-
),
27-
)
28-
]
12+
cloud_names = ["s3", "gs", "azure", "gdrive", "oss", "ssh", "http", "hdfs"]
13+
clouds = [pytest.lazy_fixture(cloud) for cloud in cloud_names]
2914
all_clouds = [pytest.lazy_fixture("local_cloud")] + clouds
3015

3116
# `lazy_fixture` is confusing pylint, pylint: disable=unused-argument
@@ -85,14 +70,9 @@ def test_open(tmp_dir, dvc, remote):
8570
"gdrive",
8671
"oss",
8772
"http",
73+
"hdfs",
8874
]
8975
],
90-
pytest.param(
91-
pytest.lazy_fixture("hdfs"),
92-
marks=pytest.mark.xfail(
93-
reason="https://github.com/iterative/dvc/issues/4418",
94-
),
95-
),
9676
pytest.param(
9777
pytest.lazy_fixture("ssh"),
9878
marks=pytest.mark.xfail(
@@ -141,24 +121,17 @@ def test_open_granular(tmp_dir, dvc, remote):
141121
@pytest.mark.parametrize(
142122
"remote",
143123
[
144-
*[
145-
pytest.lazy_fixture(cloud)
146-
for cloud in [
147-
"real_s3", # NOTE: moto's s3 fails in some tests
148-
"gs",
149-
"azure",
150-
"gdrive",
151-
"oss",
152-
"ssh",
153-
"http",
154-
]
155-
],
156-
pytest.param(
157-
pytest.lazy_fixture("hdfs"),
158-
marks=pytest.mark.xfail(
159-
reason="https://github.com/iterative/dvc/issues/4418",
160-
),
161-
),
124+
pytest.lazy_fixture(cloud)
125+
for cloud in [
126+
"real_s3", # NOTE: moto's s3 fails in some tests
127+
"gs",
128+
"azure",
129+
"gdrive",
130+
"oss",
131+
"ssh",
132+
"http",
133+
"hdfs",
134+
]
162135
],
163136
indirect=True,
164137
)

tests/func/test_gc.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -354,12 +354,7 @@ def test_gc_not_collect_pipeline_tracked_files(tmp_dir, dvc, run_copy):
354354
pytest.lazy_fixture("local_cloud"),
355355
pytest.lazy_fixture("s3"),
356356
pytest.lazy_fixture("gs"),
357-
pytest.param(
358-
pytest.lazy_fixture("hdfs"),
359-
marks=pytest.mark.xfail(
360-
reason="https://github.com/iterative/dvc/issues/4418"
361-
),
362-
),
357+
pytest.lazy_fixture("hdfs"),
363358
pytest.param(
364359
pytest.lazy_fixture("ssh"),
365360
marks=pytest.mark.skipif(

tests/func/test_import_url.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,7 @@ def test_import_url_with_no_exec(tmp_dir, dvc, erepo_dir):
121121
pytest.lazy_fixture("local_cloud"),
122122
pytest.lazy_fixture("s3"),
123123
pytest.lazy_fixture("gs"),
124-
pytest.param(
125-
pytest.lazy_fixture("hdfs"),
126-
marks=pytest.mark.xfail(
127-
reason="https://github.com/iterative/dvc/issues/4418"
128-
),
129-
),
124+
pytest.lazy_fixture("hdfs"),
130125
pytest.param(
131126
pytest.lazy_fixture("ssh"),
132127
marks=pytest.mark.skipif(
@@ -164,13 +159,10 @@ def test_import_url(tmp_dir, dvc, workspace):
164159
"dc24e1271084ee317ac3c2656fb8812b",
165160
"b6dcab6ccd17ca0a8bf4a215a37d14cc.dir",
166161
),
167-
pytest.param(
162+
(
168163
pytest.lazy_fixture("hdfs"),
169164
"ec0943f83357f702033c98e70b853c8c",
170165
"e6dcd267966dc628d732874f94ef4280.dir",
171-
marks=pytest.mark.xfail(
172-
reason="https://github.com/iterative/dvc/issues/4418"
173-
),
174166
),
175167
pytest.param(
176168
pytest.lazy_fixture("ssh"),

tests/func/test_run_multistage.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -386,15 +386,10 @@ def test_run_overwrite_preserves_meta_and_comment(tmp_dir, dvc, run_copy):
386386
"37b51d194a7513e45b56f6524f2d51f2",
387387
),
388388
(
389-
pytest.param(
390-
pytest.lazy_fixture("hdfs"),
391-
"checksum",
392-
"0000020000000000000000003dba826b9be9c6a8e2f8310a770555c4",
393-
"00000200000000000000000075433c81259d3c38e364b348af52e84d",
394-
marks=pytest.mark.xfail(
395-
reason="https://github.com/iterative/dvc/issues/4418"
396-
),
397-
)
389+
pytest.lazy_fixture("hdfs"),
390+
"checksum",
391+
"0000020000000000000000003dba826b9be9c6a8e2f8310a770555c4",
392+
"00000200000000000000000075433c81259d3c38e364b348af52e84d",
398393
),
399394
],
400395
indirect=["workspace"],

tests/func/test_update.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,7 @@ def test_update_before_and_after_dvc_init(tmp_dir, dvc, git_dir):
172172
pytest.lazy_fixture("local_cloud"),
173173
pytest.lazy_fixture("s3"),
174174
pytest.lazy_fixture("gs"),
175-
pytest.param(
176-
pytest.lazy_fixture("hdfs"),
177-
marks=pytest.mark.xfail(
178-
reason="https://github.com/iterative/dvc/issues/4418",
179-
),
180-
),
175+
pytest.lazy_fixture("hdfs"),
181176
pytest.param(
182177
pytest.lazy_fixture("ssh"),
183178
marks=pytest.mark.skipif(

tests/remotes/hdfs.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ def read_text(self, encoding=None, errors=None):
7070

7171
@pytest.fixture(scope="session")
7272
def hadoop():
73-
import tarfile
74-
7573
import wget
7674
from appdirs import user_cache_dir
7775

@@ -100,8 +98,7 @@ def _get(url, tar, target):
10098

10199
if not os.path.exists(tar):
102100
wget.download(url, out=tar)
103-
tar = tarfile.open(tar)
104-
tar.extractall(dname)
101+
assert os.system(f"tar -xvf {tar} -C {dname}") == 0
105102
assert os.path.isdir(target)
106103

107104
os.makedirs(dname, exist_ok=True)

0 commit comments

Comments
 (0)