Skip to content

Commit

Permalink
rename Mac-specific func test categories for POSIX
Browse files Browse the repository at this point in the history
We convert the MacOnly functional test category into POSIXOnly,
which we also execute on Linux, and we convert the MacTODO
category to NonWindowsTODO and exclude it on Linux (as well as
on macOS).

From microsoft/VFSForGit@9b6fd56
and microsoft/VFSForGit@f47f68c.
  • Loading branch information
chrisd8088 committed Aug 18, 2020
1 parent 66b6acb commit 883f15b
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Scalar.FunctionalTests/Categories.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ public static class Categories
public const string GitCommands = "GitCommands";

public const string WindowsOnly = "WindowsOnly";
public const string MacOnly = "MacOnly";
public const string POSIXOnly = "POSIXOnly";

public const string GitRepository = "GitRepository";

public const string NeedsUpdatesForNonVirtualizedMode = "NeedsUpdatesForNonVirtualizedMode";

public static class MacTODO
public static class NonWindowsTODO
{
// Tests requires code updates so that we lock the file instead of looking for a .lock file
public const string TestNeedsToLockFile = "TestNeedsToLockFile";
Expand Down
7 changes: 4 additions & 3 deletions Scalar.FunctionalTests/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ public static void Main(string[] args)
ScalarTestConfig.FileSystemRunners = FileSystemRunners.FileSystemRunner.DefaultRunners;
}

if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) ||
RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
excludeCategories.Add(Categories.MacTODO.TestNeedsToLockFile);
excludeCategories.Add(Categories.NonWindowsTODO.TestNeedsToLockFile);
excludeCategories.Add(Categories.WindowsOnly);
}
else
Expand All @@ -99,7 +100,7 @@ public static void Main(string[] args)
includeCategories.Remove(Categories.ExtraCoverage);
}

excludeCategories.Add(Categories.MacOnly);
excludeCategories.Add(Categories.POSIXOnly);
}

// For now, run all of the tests not flagged as needing to be updated to work
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void SparseCloneWithNoFetchOfCommitsAndTreesSucceeds()
}

[TestCase]
[Category(Categories.MacOnly)]
[Category(Categories.POSIXOnly)]
public void CloneWithDefaultLocalCacheLocation()
{
FileSystemRunner fileSystem = FileSystemRunner.DefaultRunner;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public FetchStepTests()
}

[TestCase]
[Category(Categories.MacTODO.TestNeedsToLockFile)]
[Category(Categories.NonWindowsTODO.TestNeedsToLockFile)]
public void FetchStepCleansUpStaleFetchLock()
{
this.Enlistment.RunVerb("fetch");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void FetchStepCleansUpBadPrefetchPack()
}

[TestCase, Order(4)]
[Category(Categories.MacTODO.TestNeedsToLockFile)]
[Category(Categories.NonWindowsTODO.TestNeedsToLockFile)]
public void FetchStepFailsWhenItCannotRemoveABadPrefetchPack()
{
this.Enlistment.Unregister();
Expand Down
8 changes: 4 additions & 4 deletions Scalar.FunctionalTests/Tests/GitCommands/GitCommandsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -548,17 +548,17 @@ public void RenameFileCommitChangesSwitchBranchSwitchBackTest()
this.CommitChangesSwitchBranchSwitchBack(fileSystemAction: this.RenameFile);
}

// MacOnly because renames of partial folders are blocked on Windows
// Mac and Linux only because renames of partial folders are blocked on Windows
[TestCase]
[Category(Categories.MacOnly)]
[Category(Categories.POSIXOnly)]
public void MoveFolderCommitChangesSwitchBranchSwitchBackTest()
{
this.CommitChangesSwitchBranchSwitchBack(fileSystemAction: this.MoveFolder);
}

// MacOnly because Windows does not support file mode
// Mac and Linux only because Windows does not support file mode
[TestCase]
[Category(Categories.MacOnly)]
[Category(Categories.POSIXOnly)]
public void UpdateFileModeOnly()
{
const string TestFileName = "test-file-mode";
Expand Down

0 comments on commit 883f15b

Please sign in to comment.