-
Notifications
You must be signed in to change notification settings - Fork 460
stop blocking unsupported git commands #597
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| using GVFS.FunctionalTests.FileSystemRunners; | ||
| using GVFS.FunctionalTests.Should; | ||
| using GVFS.FunctionalTests.Tools; | ||
| using GVFS.Tests.Should; | ||
| using NUnit.Framework; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.IO; | ||
| using System.Runtime.InteropServices; | ||
|
|
||
| namespace GVFS.FunctionalTests.Tests.EnlistmentPerFixture | ||
| { | ||
| [TestFixtureSource(typeof(FileSystemRunner), nameof(FileSystemRunner.Runners))] | ||
| [Category(Categories.GitCommands)] | ||
| public class GitBlockCommandsTests : TestsWithEnlistmentPerFixture | ||
| { | ||
| private FileSystemRunner fileSystem; | ||
| public GitBlockCommandsTests(FileSystemRunner fileSystem) | ||
| { | ||
| this.fileSystem = fileSystem; | ||
| } | ||
|
|
||
| [TestCase, Order(1)] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does order really matter in these tests? |
||
| public void GitFsck() | ||
| { | ||
| ProcessResult result = GitHelpers.InvokeGitAgainstGVFSRepo( | ||
| this.Enlistment.RepoRoot, | ||
| "fsck"); | ||
| result.ExitCode.ShouldNotEqual(0, result.Errors); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would maybe add a function that is: And have a similar method for |
||
| } | ||
|
|
||
| [TestCase, Order(2)] | ||
| public void GitGc() | ||
| { | ||
| ProcessResult result = GitHelpers.InvokeGitAgainstGVFSRepo( | ||
| this.Enlistment.RepoRoot, | ||
| "gc"); | ||
| result.ExitCode.ShouldNotEqual(0, result.Errors); | ||
| result = GitHelpers.InvokeGitAgainstGVFSRepo( | ||
| this.Enlistment.RepoRoot, | ||
| "gc --auto"); | ||
| result.ExitCode.ShouldEqual(0, result.Errors); | ||
| } | ||
|
|
||
| [TestCase, Order(3)] | ||
| public void GitPrune() | ||
| { | ||
| ProcessResult result = GitHelpers.InvokeGitAgainstGVFSRepo( | ||
| this.Enlistment.RepoRoot, | ||
| "prune"); | ||
| result.ExitCode.ShouldNotEqual(0, result.Errors); | ||
| } | ||
|
|
||
| [TestCase, Order(4)] | ||
| public void GitRepack() | ||
| { | ||
| ProcessResult result = GitHelpers.InvokeGitAgainstGVFSRepo( | ||
| this.Enlistment.RepoRoot, | ||
| "repack"); | ||
| result.ExitCode.ShouldNotEqual(0, result.Errors); | ||
| } | ||
|
|
||
| [TestCase, Order(5)] | ||
| public void GitSubmodule() | ||
| { | ||
| ProcessResult result = GitHelpers.InvokeGitAgainstGVFSRepo( | ||
| this.Enlistment.RepoRoot, | ||
| "submodule"); | ||
| result.ExitCode.ShouldNotEqual(0, result.Errors); | ||
| result = GitHelpers.InvokeGitAgainstGVFSRepo( | ||
| this.Enlistment.RepoRoot, | ||
| "submodule status"); | ||
| result.ExitCode.ShouldNotEqual(0, result.Errors); | ||
| } | ||
|
|
||
| [TestCase, Order(6)] | ||
| public void GitUpdateIndex() | ||
| { | ||
| ProcessResult result = GitHelpers.InvokeGitAgainstGVFSRepo( | ||
| this.Enlistment.RepoRoot, | ||
| "update-index --index-version 2"); | ||
| result.ExitCode.ShouldNotEqual(0, result.Errors); | ||
| result = GitHelpers.InvokeGitAgainstGVFSRepo( | ||
| this.Enlistment.RepoRoot, | ||
| "update-index --skip-worktree"); | ||
| result.ExitCode.ShouldNotEqual(0, result.Errors); | ||
| result = GitHelpers.InvokeGitAgainstGVFSRepo( | ||
| this.Enlistment.RepoRoot, | ||
| "update-index --no-skip-worktree"); | ||
| result.ExitCode.ShouldNotEqual(0, result.Errors); | ||
| result = GitHelpers.InvokeGitAgainstGVFSRepo( | ||
| this.Enlistment.RepoRoot, | ||
| "update-index --split-index"); | ||
| result.ExitCode.ShouldNotEqual(0, result.Errors); | ||
| } | ||
|
|
||
| [TestCase, Order(7)] | ||
| public void GitWorktree() | ||
| { | ||
| ProcessResult result = GitHelpers.InvokeGitAgainstGVFSRepo( | ||
| this.Enlistment.RepoRoot, | ||
| "worktree list"); | ||
| result.ExitCode.ShouldNotEqual(0, result.Errors); | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1036,10 +1036,10 @@ public void RenameOnlyFileInFolder() | |
| public void UpdateIndexCannotModifySkipWorktreeBit() | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems like a duplicate test to the ones you added? If so I would just delete it. |
||
| { | ||
| ProcessResult result = GitHelpers.InvokeGitAgainstGVFSRepo(this.Enlistment.RepoRoot, "update-index --skip-worktree Readme.md"); | ||
| result.Errors.ShouldContain("Modifying the skip worktree bit is not supported on a GVFS repo"); | ||
| result.ExitCode.ShouldNotEqual(0); | ||
|
|
||
| result = GitHelpers.InvokeGitAgainstGVFSRepo(this.Enlistment.RepoRoot, "update-index --no-skip-worktree Readme.md"); | ||
| result.Errors.ShouldContain("Modifying the skip worktree bit is not supported on a GVFS repo"); | ||
| result.ExitCode.ShouldNotEqual(0); | ||
| } | ||
|
|
||
| [TestCase] | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need to parameterize these tests on
FileSystemRunneras they never usethis.fileSystem.[TestFixtureSource(typeof(FileSystemRunner), nameof(FileSystemRunner.Runners))]can be replaced with[TestFixture]and theFileSystemRunner fileSystemparameter can be removed from the constructor.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@benpeart I see I was too late with this comment, I will create a PR with this change.