[Linux] Revise functional tests for cross-device mounts#1413
[Linux] Revise functional tests for cross-device mounts#1413chrisd8088 merged 2 commits intomicrosoft:masterfrom
Conversation
58afa47 to
facd52f
Compare
b4640b8 to
104b1a2
Compare
wilbaker
left a comment
There was a problem hiding this comment.
Finished a first pass over the changes.
I have not left any comments on ModifiedPathsTests.cs yet as I'd like to hear your thoughts on only adding a RepositoryMountsSameFileSystem category and having the "copy+delete" (i.e. bash mv) tests run on all filesystems.
GVFS/GVFS.FunctionalTests/Tests/EnlistmentPerFixture/GitMoveRenameTests.cs
Outdated
Show resolved
Hide resolved
GVFS/GVFS.FunctionalTests/Tests/GitCommands/GitCommandsTests.cs
Outdated
Show resolved
Hide resolved
GVFS/GVFS.FunctionalTests/Tests/GitCommands/GitCommandsTests.cs
Outdated
Show resolved
Hide resolved
c26e49f to
8d132b0
Compare
|
@wilbaker -- I think I've managed to simplify this so that we just ignore the tests which don't apply if cross-device renaming (and hard-linking) are not supported; I can't, on reflection, see much value in emulating them by copying files. The exceptions, sort of, are the two main tests in |
|
Just as an added thought, @wilbaker, I can also submit these changes as a series of smaller PRs -- e.g., one each for |
@chrisd8088 if you don't mind making that change I think it would be easier/quicker to review these changes in chunks. Thanks! |
8d132b0 to
969b6b0
Compare
|
/azp run GitHub VFSForGit Mac Functional Tests |
|
No pipelines are associated with this pull request. |
|
/azp run GitHub VFSForGit Mac Functional Tests |
|
No pipelines are associated with this pull request. |
|
/azp run GitHub VFSForGit Mac Functional Tests |
|
No pipelines are associated with this pull request. |
|
/azp run GitHub VFSForGit Mac Functional Tests |
|
No pipelines are associated with this pull request. |
wilbaker
left a comment
There was a problem hiding this comment.
Overall the changes look good, I am having trouble seeing where we're including/excluding RepositoryMountsSameFileSystem tests with these changes.
GVFS/GVFS.FunctionalTests/Tests/EnlistmentPerFixture/GVFSLockTests.cs
Outdated
Show resolved
Hide resolved
On POSIX, where a rename(2) returns EXDEV when trying to move a file or directory between mounted filesystems, the functional tests which do this currently fail if the repository is mounted on a separate device (as is the case on Linux). Therefore we create a RepositoryMountsSameFileSystem test category for use on VFSForGit implementations which allow rename(2) across repository boundaries (i.e., Windows PrjFlt and Mac kext), and mark a number of tests which move contents in or out of the repository with this category designation. In the ModifiedPathsTests suite, two specific tests which check the contents of the ModifiedPaths database after remounting and after hard-linking, specifically, are subdivided into pairs of tests. Each pair consists of one test which only checks changes that do not cross the repository boundary, suitable for all implementations, and one test which check changes spanning the repository boundary and which is marked with the RepositoryMountsSameFileSystem category.
Per PR advice from wilbaker, we avoid sprinkling comments throughout the functional test suite regarding the use of the RepositoryMountsSameFileSystem category, and instead add a more verbose description in Categories.cs which should clarify the expected use case for this test flag.
969b6b0 to
d28ed04
Compare
On POSIX systems, where a
rename(2)returnsEXDEVwhen trying to move a file or directory between mounted filesystems, the functional tests which do this currently fail if therepository is mounted on a separate device (as is the case on Linux).
Therefore we create a
RepositoryMountsSameFileSystemtest category for use on VFSForGit implementations which allow renaming across repository boundaries (i.e., Windows PrjFltand Mac kext), and mark a number of tests with this category designation as they move files or folders in or out of the repository, or create hard links across the repository boundary.
In the
ModifiedPathsTestssuite, two specific tests which check the contents of the modified-paths database after remounting and after hard-linking, specifically, are subdivided into pairs of tests. Each pair consists of one test which only checks changes that do not cross the repository boundary, suitable for all implementations, and one test which check changes spanning the repository boundary and which is marked with theRepositoryMountsSameFileSystemcategory.