From 883f15b04308ded2279bb676251f8944147eae44 Mon Sep 17 00:00:00 2001 From: Chris Darroch Date: Sat, 15 Aug 2020 01:18:31 -0700 Subject: [PATCH] rename Mac-specific func test categories for POSIX 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@9b6fd56ad7993f5cb357c64d97b3b98441a6b758 and microsoft/VFSForGit@f47f68c5c0e1715018633c3bb057d0284e2fbb62. --- Scalar.FunctionalTests/Categories.cs | 4 ++-- Scalar.FunctionalTests/Program.cs | 7 ++++--- .../Tests/EnlistmentPerFixture/CloneTests.cs | 2 +- .../Tests/EnlistmentPerFixture/FetchStepTests.cs | 2 +- .../FetchStepWithoutSharedCacheTests.cs | 2 +- .../Tests/GitCommands/GitCommandsTests.cs | 8 ++++---- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Scalar.FunctionalTests/Categories.cs b/Scalar.FunctionalTests/Categories.cs index 2bdab7e15e6..9e841cec354 100644 --- a/Scalar.FunctionalTests/Categories.cs +++ b/Scalar.FunctionalTests/Categories.cs @@ -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"; diff --git a/Scalar.FunctionalTests/Program.cs b/Scalar.FunctionalTests/Program.cs index 2f8330fd2c6..18bbb72503e 100644 --- a/Scalar.FunctionalTests/Program.cs +++ b/Scalar.FunctionalTests/Program.cs @@ -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 @@ -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 diff --git a/Scalar.FunctionalTests/Tests/EnlistmentPerFixture/CloneTests.cs b/Scalar.FunctionalTests/Tests/EnlistmentPerFixture/CloneTests.cs index 4955e96b19e..09591b839b3 100644 --- a/Scalar.FunctionalTests/Tests/EnlistmentPerFixture/CloneTests.cs +++ b/Scalar.FunctionalTests/Tests/EnlistmentPerFixture/CloneTests.cs @@ -57,7 +57,7 @@ public void SparseCloneWithNoFetchOfCommitsAndTreesSucceeds() } [TestCase] - [Category(Categories.MacOnly)] + [Category(Categories.POSIXOnly)] public void CloneWithDefaultLocalCacheLocation() { FileSystemRunner fileSystem = FileSystemRunner.DefaultRunner; diff --git a/Scalar.FunctionalTests/Tests/EnlistmentPerFixture/FetchStepTests.cs b/Scalar.FunctionalTests/Tests/EnlistmentPerFixture/FetchStepTests.cs index e9115e67a70..578916a86f9 100644 --- a/Scalar.FunctionalTests/Tests/EnlistmentPerFixture/FetchStepTests.cs +++ b/Scalar.FunctionalTests/Tests/EnlistmentPerFixture/FetchStepTests.cs @@ -23,7 +23,7 @@ public FetchStepTests() } [TestCase] - [Category(Categories.MacTODO.TestNeedsToLockFile)] + [Category(Categories.NonWindowsTODO.TestNeedsToLockFile)] public void FetchStepCleansUpStaleFetchLock() { this.Enlistment.RunVerb("fetch"); diff --git a/Scalar.FunctionalTests/Tests/EnlistmentPerFixture/FetchStepWithoutSharedCacheTests.cs b/Scalar.FunctionalTests/Tests/EnlistmentPerFixture/FetchStepWithoutSharedCacheTests.cs index adc1f5b07b0..798cb253e59 100644 --- a/Scalar.FunctionalTests/Tests/EnlistmentPerFixture/FetchStepWithoutSharedCacheTests.cs +++ b/Scalar.FunctionalTests/Tests/EnlistmentPerFixture/FetchStepWithoutSharedCacheTests.cs @@ -102,7 +102,7 @@ public void FetchStepCleansUpBadPrefetchPack() } [TestCase, Order(4)] - [Category(Categories.MacTODO.TestNeedsToLockFile)] + [Category(Categories.NonWindowsTODO.TestNeedsToLockFile)] public void FetchStepFailsWhenItCannotRemoveABadPrefetchPack() { this.Enlistment.Unregister(); diff --git a/Scalar.FunctionalTests/Tests/GitCommands/GitCommandsTests.cs b/Scalar.FunctionalTests/Tests/GitCommands/GitCommandsTests.cs index 8c5805a54aa..503bda55677 100644 --- a/Scalar.FunctionalTests/Tests/GitCommands/GitCommandsTests.cs +++ b/Scalar.FunctionalTests/Tests/GitCommands/GitCommandsTests.cs @@ -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";