Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6e477e3

Browse files
committed
Add xfail marks for IndexFile.from_tree failures
8 of the tests that fail on native Windows systems fail due toIndexFile.from_tree being broken on Windows, causing#1630.This commit marks those tests as xfail. This is part, though notall, of the changes to get CI test jobs for native Windows thatare passing, to guard against new regressions and to allow the codeand tests to be gradually fixed (see discussion in#1654).When fixing the bug, this commit can be reverted.
1 parent2fd79f4 commit6e477e3

File tree

4 files changed

+74
-5
lines changed

4 files changed

+74
-5
lines changed

‎test/test_docs.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88

99
importpytest
1010

11+
fromgit.excimportGitCommandError
1112
fromtest.libimportTestBase
1213
fromtest.lib.helperimportwith_rw_directory
1314

14-
importos.path
15-
1615

1716
classTutorials(TestBase):
1817
deftearDown(self):
@@ -207,6 +206,14 @@ def update(self, op_code, cur_count, max_count=None, message=""):
207206
assertsm.module_exists()# The submodule's working tree was checked out by update.
208207
# ![14-test_init_repo_object]
209208

209+
@pytest.mark.xfail(
210+
os.name=="nt",
211+
reason=(
212+
"IndexFile.from_tree is broken on Windows (related to NamedTemporaryFile), see #1630.\n"
213+
"'git read-tree --index-output=...' fails with 'fatal: unable to write new index file'."
214+
),
215+
raises=GitCommandError,
216+
)
210217
@with_rw_directory
211218
deftest_references_and_objects(self,rw_dir):
212219
# [1-test_references_and_objects]

‎test/test_fun.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33

44
fromioimportBytesIO
55
fromstatimportS_IFDIR,S_IFREG,S_IFLNK,S_IXUSR
6-
fromosimportstat
6+
importos
77
importos.pathasosp
88

9+
importpytest
10+
911
fromgitimportGit
12+
fromgit.excimportGitCommandError
1013
fromgit.indeximportIndexFile
1114
fromgit.index.funimport (
1215
aggressive_tree_merge,
@@ -34,6 +37,14 @@ def _assert_index_entries(self, entries, trees):
3437
assert (entry.path,entry.stage)inindex.entries
3538
# END assert entry matches fully
3639

40+
@pytest.mark.xfail(
41+
os.name=="nt",
42+
reason=(
43+
"IndexFile.from_tree is broken on Windows (related to NamedTemporaryFile), see #1630.\n"
44+
"'git read-tree --index-output=...' fails with 'fatal: unable to write new index file'."
45+
),
46+
raises=GitCommandError,
47+
)
3748
deftest_aggressive_tree_merge(self):
3849
# Head tree with additions, removals and modification compared to its predecessor.
3950
odb=self.rorepo.odb
@@ -291,12 +302,12 @@ def test_linked_worktree_traversal(self, rw_dir):
291302
rw_master.git.worktree("add",worktree_path,branch.name)
292303

293304
dotgit=osp.join(worktree_path,".git")
294-
statbuf=stat(dotgit)
305+
statbuf=os.stat(dotgit)
295306
self.assertTrue(statbuf.st_mode&S_IFREG)
296307

297308
gitdir=find_worktree_git_dir(dotgit)
298309
self.assertIsNotNone(gitdir)
299-
statbuf=stat(gitdir)
310+
statbuf=os.stat(gitdir)
300311
self.assertTrue(statbuf.st_mode&S_IFDIR)
301312

302313
deftest_tree_entries_from_data_with_failing_name_decode_py3(self):

‎test/test_index.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,14 @@ def add_bad_blob():
179179
exceptExceptionasex:
180180
assert"index.lock' could not be obtained"notinstr(ex)
181181

182+
@pytest.mark.xfail(
183+
os.name=="nt",
184+
reason=(
185+
"IndexFile.from_tree is broken on Windows (related to NamedTemporaryFile), see #1630.\n"
186+
"'git read-tree --index-output=...' fails with 'fatal: unable to write new index file'."
187+
),
188+
raises=GitCommandError,
189+
)
182190
@with_rw_repo("0.1.6")
183191
deftest_index_file_from_tree(self,rw_repo):
184192
common_ancestor_sha="5117c9c8a4d3af19a9958677e45cda9269de1541"
@@ -229,6 +237,14 @@ def test_index_file_from_tree(self, rw_repo):
229237
# END for each blob
230238
self.assertEqual(num_blobs,len(three_way_index.entries))
231239

240+
@pytest.mark.xfail(
241+
os.name=="nt",
242+
reason=(
243+
"IndexFile.from_tree is broken on Windows (related to NamedTemporaryFile), see #1630.\n"
244+
"'git read-tree --index-output=...' fails with 'fatal: unable to write new index file'."
245+
),
246+
raises=GitCommandError,
247+
)
232248
@with_rw_repo("0.1.6")
233249
deftest_index_merge_tree(self,rw_repo):
234250
# A bit out of place, but we need a different repo for this:
@@ -291,6 +307,14 @@ def test_index_merge_tree(self, rw_repo):
291307
self.assertEqual(len(unmerged_blobs),1)
292308
self.assertEqual(list(unmerged_blobs.keys())[0],manifest_key[0])
293309

310+
@pytest.mark.xfail(
311+
os.name=="nt",
312+
reason=(
313+
"IndexFile.from_tree is broken on Windows (related to NamedTemporaryFile), see #1630.\n"
314+
"'git read-tree --index-output=...' fails with 'fatal: unable to write new index file'."
315+
),
316+
raises=GitCommandError,
317+
)
294318
@with_rw_repo("0.1.6")
295319
deftest_index_file_diffing(self,rw_repo):
296320
# Default Index instance points to our index.
@@ -425,6 +449,14 @@ def _count_existing(self, repo, files):
425449

426450
# END num existing helper
427451

452+
@pytest.mark.xfail(
453+
os.name=="nt",
454+
reason=(
455+
"IndexFile.from_tree is broken on Windows (related to NamedTemporaryFile), see #1630.\n"
456+
"'git read-tree --index-output=...' fails with 'fatal: unable to write new index file'."
457+
),
458+
raises=GitCommandError,
459+
)
428460
@with_rw_repo("0.1.6")
429461
deftest_index_mutation(self,rw_repo):
430462
index=rw_repo.index
@@ -778,6 +810,14 @@ def make_paths():
778810
forabsfileinabsfiles:
779811
assertosp.isfile(absfile)
780812

813+
@pytest.mark.xfail(
814+
os.name=="nt",
815+
reason=(
816+
"IndexFile.from_tree is broken on Windows (related to NamedTemporaryFile), see #1630.\n"
817+
"'git read-tree --index-output=...' fails with 'fatal: unable to write new index file'."
818+
),
819+
raises=GitCommandError,
820+
)
781821
@with_rw_repo("HEAD")
782822
deftest_compare_write_tree(self,rw_repo):
783823
"""Test writing all trees, comparing them for equality."""

‎test/test_refs.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
55

66
fromitertoolsimportchain
7+
importos
78
frompathlibimportPath
89

10+
importpytest
11+
912
fromgitimport (
1013
Reference,
1114
Head,
@@ -215,6 +218,14 @@ def test_head_checkout_detached_head(self, rw_repo):
215218
assertisinstance(res,SymbolicReference)
216219
assertres.name=="HEAD"
217220

221+
@pytest.mark.xfail(
222+
os.name=="nt",
223+
reason=(
224+
"IndexFile.from_tree is broken on Windows (related to NamedTemporaryFile), see #1630.\n"
225+
"'git read-tree --index-output=...' fails with 'fatal: unable to write new index file'."
226+
),
227+
raises=GitCommandError,
228+
)
218229
@with_rw_repo("0.1.6")
219230
deftest_head_reset(self,rw_repo):
220231
cur_head=rw_repo.head

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp