Skip to content

Commit

Permalink
FunctionalTests: Use temporary branch to fix all tests
Browse files Browse the repository at this point in the history
Signed-off-by: Derrick Stolee <[email protected]>
  • Loading branch information
derrickstolee committed Oct 15, 2020
1 parent b9c6445 commit 3d4436b
Show file tree
Hide file tree
Showing 14 changed files with 125 additions and 80 deletions.
8 changes: 7 additions & 1 deletion GVFS/GVFS.FunctionalTests/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ public static void Initialize()
CurrentDirectory = Path.GetFullPath(Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]));

RepoToClone = @"https://gvfs.visualstudio.com/ci/_git/ForTests";
Commitish = @"FunctionalTests/20180214";

// HACK: This is only different from FunctionalTests/20180214
// in that it deletes the GVFlt_MoveFileTests/LongFileName folder,
// which is causing problems in all tests due to a ProjFS
// regression. Replace this with the expected default after
// ProjFS is fixed and deployed to our build machines.
Commitish = @"FunctionalTests/20201014";

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void GitCheckoutFailsOutsideLock()
this.fileSystem.MoveFile(Path.Combine(hooksBase, preCommand), Path.Combine(hooksBase, BackupPrefix + preCommand));
this.fileSystem.MoveFile(Path.Combine(hooksBase, postCommand), Path.Combine(hooksBase, BackupPrefix + postCommand));

ProcessResult result = GitHelpers.InvokeGitAgainstGVFSRepo(this.Enlistment.RepoRoot, "checkout FunctionalTests/20170510_minor");
ProcessResult result = GitHelpers.InvokeGitAgainstGVFSRepo(this.Enlistment.RepoRoot, "checkout FunctionalTests/20201014_minor");
result.Errors.ShouldContain("fatal: unable to write new index file");

// Ensure that branch didnt move, note however that work dir might not be clean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void AfterCloningRepoIsPerfectlyHealthy()

this.ValidateHealthOutputValues(
directory: string.Empty,
totalFiles: 1211,
totalFiles: 1197,
totalFilePercent: 100,
fastFiles: 1,
fastFilePercent: 0,
Expand Down Expand Up @@ -53,7 +53,7 @@ public void PlaceholdersChangeHealthScores()

this.ValidateHealthOutputValues(
directory: string.Empty,
totalFiles: 1211,
totalFiles: 1197,
totalFilePercent: 100,
fastFiles: 7,
fastFilePercent: 1,
Expand All @@ -78,7 +78,7 @@ public void ModifiedPathsChangeHealthScores()

this.ValidateHealthOutputValues(
directory: string.Empty,
totalFiles: 1211,
totalFiles: 1197,
totalFilePercent: 100,
fastFiles: 8,
fastFilePercent: 1,
Expand All @@ -105,7 +105,7 @@ public void TurnPlaceholdersIntoModifiedPaths()

this.ValidateHealthOutputValues(
directory: string.Empty,
totalFiles: 1211,
totalFiles: 1197,
totalFilePercent: 100,
fastFiles: 3,
fastFilePercent: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace GVFS.FunctionalTests.Tests.EnlistmentPerFixture
public class PrefetchVerbTests : TestsWithEnlistmentPerFixture
{
private const string PrefetchCommitsAndTreesLock = "prefetch-commits-trees.lock";
private const string LsTreeTypeInPathBranchName = "FunctionalTests/20181105_LsTreeTypeInPath";
private const string LsTreeTypeInPathBranchName = "FunctionalTests/20201014_LsTreeTypeInPath";

// on case-insensitive filesystems, test case-blind matching in
// folder lists using "gvfs/" instead of "GVFS/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ public SymbolicLinkTests()
[TestCase, Order(1)]
public void CheckoutBranchWithSymLinks()
{
GitHelpers.InvokeGitAgainstGVFSRepo(this.Enlistment.RepoRoot, "checkout FunctionalTests/20180925_SymLinksPart1");
GitHelpers.InvokeGitAgainstGVFSRepo(this.Enlistment.RepoRoot, "checkout FunctionalTests/20201014_SymLinksPart1");
GitHelpers.CheckGitCommandAgainstGVFSRepo(
this.Enlistment.RepoRoot,
"status",
"On branch FunctionalTests/20180925_SymLinksPart1",
"On branch FunctionalTests/20201014_SymLinksPart1",
"nothing to commit, working tree clean");

string testFilePath = this.Enlistment.GetVirtualPathTo(Path.Combine(TestFolderName, TestFileName));
Expand All @@ -75,11 +75,11 @@ public void CheckoutBranchWithSymLinks()
[TestCase, Order(2)]
public void CheckoutBranchWhereSymLinksChangeContentsAndTransitionToFile()
{
GitHelpers.InvokeGitAgainstGVFSRepo(this.Enlistment.RepoRoot, "checkout FunctionalTests/20180925_SymLinksPart2");
GitHelpers.InvokeGitAgainstGVFSRepo(this.Enlistment.RepoRoot, "checkout FunctionalTests/20201014_SymLinksPart2");
GitHelpers.CheckGitCommandAgainstGVFSRepo(
this.Enlistment.RepoRoot,
"status",
"On branch FunctionalTests/20180925_SymLinksPart2",
"On branch FunctionalTests/20201014_SymLinksPart2",
"nothing to commit, working tree clean");

// testFilePath and testFile2Path are unchanged from FunctionalTests/20180925_SymLinksPart2
Expand Down Expand Up @@ -114,11 +114,11 @@ public void CheckoutBranchWhereSymLinksChangeContentsAndTransitionToFile()
[TestCase, Order(3)]
public void CheckoutBranchWhereFilesTransitionToSymLinks()
{
GitHelpers.InvokeGitAgainstGVFSRepo(this.Enlistment.RepoRoot, "checkout FunctionalTests/20180925_SymLinksPart3");
GitHelpers.InvokeGitAgainstGVFSRepo(this.Enlistment.RepoRoot, "checkout FunctionalTests/20201014_SymLinksPart3");
GitHelpers.CheckGitCommandAgainstGVFSRepo(
this.Enlistment.RepoRoot,
"status",
"On branch FunctionalTests/20180925_SymLinksPart3",
"On branch FunctionalTests/20201014_SymLinksPart3",
"nothing to commit, working tree clean");

// In this branch testFilePath has been changed to point to newGrandChildFilePath
Expand Down Expand Up @@ -155,11 +155,11 @@ public void CheckoutBranchWhereFilesTransitionToSymLinks()
[TestCase, Order(4)]
public void CheckoutBranchWhereSymLinkTransistionsToFolderAndFolderTransitionsToSymlink()
{
GitHelpers.InvokeGitAgainstGVFSRepo(this.Enlistment.RepoRoot, "checkout FunctionalTests/20180925_SymLinksPart4");
GitHelpers.InvokeGitAgainstGVFSRepo(this.Enlistment.RepoRoot, "checkout FunctionalTests/20201014_SymLinksPart4");
GitHelpers.CheckGitCommandAgainstGVFSRepo(
this.Enlistment.RepoRoot,
"status",
"On branch FunctionalTests/20180925_SymLinksPart4",
"On branch FunctionalTests/20201014_SymLinksPart4",
"nothing to commit, working tree clean");

// In this branch ChildLinkName has been changed to a directory and ChildFolder2Name has been changed to a link to ChildFolderName
Expand All @@ -179,7 +179,7 @@ public void GitStatusReportsSymLinkChanges()
GitHelpers.CheckGitCommandAgainstGVFSRepo(
this.Enlistment.RepoRoot,
"status",
"On branch FunctionalTests/20180925_SymLinksPart4",
"On branch FunctionalTests/20201014_SymLinksPart4",
"nothing to commit, working tree clean");

string testFilePath = this.Enlistment.GetVirtualPathTo(Path.Combine(TestFolderName, TestFileName));
Expand All @@ -199,7 +199,7 @@ public void GitStatusReportsSymLinkChanges()
GitHelpers.CheckGitCommandAgainstGVFSRepo(
this.Enlistment.RepoRoot,
"status",
"On branch FunctionalTests/20180925_SymLinksPart4",
"On branch FunctionalTests/20201014_SymLinksPart4",
$"modified: {TestFolderName}/{TestFileName}");
}
}
Expand Down
Loading

0 comments on commit 3d4436b

Please sign in to comment.