public static void Main(string[] args) { NUnitRunner runner = new NUnitRunner(args); if (runner.HasCustomArg("--no-shared-gvfs-cache")) { Console.WriteLine("Running without a shared git object cache"); GVFSTestConfig.NoSharedCache = true; } GVFSTestConfig.LocalCacheRoot = runner.GetCustomArgWithParam("--shared-gvfs-cache-root"); if (runner.HasCustomArg("--full-suite")) { Console.WriteLine("Running the full suite of tests"); GVFSTestConfig.UseAllRunners = true; } GVFSTestConfig.RepoToClone = runner.GetCustomArgWithParam("--repo-to-clone") ?? Properties.Settings.Default.RepoToClone; string servicePath = Path.Combine(TestContext.CurrentContext.TestDirectory, Properties.Settings.Default.PathToGVFSService); GVFSServiceProcess.InstallService(servicePath); try { Environment.ExitCode = runner.RunTests(Properties.Settings.Default.TestRepeatCount); } finally { string serviceLogFolder = Path.Combine( Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "GVFS", GVFSServiceProcess.TestServiceName, "Logs"); Console.WriteLine("GVFS.Service logs at '{0}' attached below.\n\n", serviceLogFolder); foreach (string filename in TestResultsHelper.GetAllFilesInDirectory(serviceLogFolder)) { TestResultsHelper.OutputFileContents(filename); } GVFSServiceProcess.UninstallService(); } if (Debugger.IsAttached) { Console.WriteLine("Tests completed. Press Enter to exit."); Console.ReadLine(); } }
public static void Main(string[] args) { NUnitRunner runner = new NUnitRunner(args); if (runner.HasCustomArg("--full-suite")) { Console.WriteLine("Running the full suite of tests"); FileSystemRunners.FileSystemRunner.UseAllRunners = true; } if (!runner.HasCustomArg("--run-builds")) { runner.ExcludeCategory(CategoryConstants.Build); } Environment.ExitCode = runner.RunTests(Properties.Settings.Default.TestRepeatCount); }
public static void Main(string[] args) { NUnitRunner runner = new NUnitRunner(args); if (runner.HasCustomArg("--full-suite")) { Console.WriteLine("Running the full suite of tests"); FileSystemRunners.FileSystemRunner.UseAllRunners = true; } if (!runner.HasCustomArg("--run-builds")) { runner.ExcludeCategory(CategoryConstants.Build); } string servicePath = Path.Combine(TestContext.CurrentContext.TestDirectory, Properties.Settings.Default.PathToGVFSService); GVFSServiceProcess.InstallService(servicePath); try { Environment.ExitCode = runner.RunTests(Properties.Settings.Default.TestRepeatCount); } finally { string serviceLogFolder = Path.Combine( Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "GVFS", GVFSServiceProcess.TestServiceName, "Logs"); Console.WriteLine("GVFS.Service logs at '{0}' attached below.\n\n", serviceLogFolder); foreach (string filename in TestResultsHelper.GetAllFilesInDirectory(serviceLogFolder)) { TestResultsHelper.OutputFileContents(filename); } GVFSServiceProcess.UninstallService(); } if (Debugger.IsAttached) { Console.WriteLine("Tests completed. Press Enter to exit."); Console.ReadLine(); } }
public static void Main(string[] args) { Properties.Settings.Default.Initialize(); NUnitRunner runner = new NUnitRunner(args); if (runner.HasCustomArg("--no-shared-gvfs-cache")) { Console.WriteLine("Running without a shared git object cache"); GVFSTestConfig.NoSharedCache = true; } if (runner.HasCustomArg("--test-gvfs-on-path")) { Console.WriteLine("Running tests against GVFS on path"); GVFSTestConfig.TestGVFSOnPath = true; } if (runner.HasCustomArg("--replace-inbox-projfs")) { Console.WriteLine("Tests will replace inbox ProjFS"); GVFSTestConfig.ReplaceInboxProjFS = true; } GVFSTestConfig.LocalCacheRoot = runner.GetCustomArgWithParam("--shared-gvfs-cache-root"); HashSet <string> includeCategories = new HashSet <string>(); HashSet <string> excludeCategories = new HashSet <string>(); if (runner.HasCustomArg("--full-suite")) { Console.WriteLine("Running the full suite of tests"); GVFSTestConfig.GitRepoTestsValidateWorkTree = DataSources.AllBools; if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { GVFSTestConfig.FileSystemRunners = FileSystemRunners.FileSystemRunner.AllWindowsRunners; } else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { GVFSTestConfig.FileSystemRunners = FileSystemRunners.FileSystemRunner.AllMacRunners; } } else { GVFSTestConfig.GitRepoTestsValidateWorkTree = new object[] { new object[] { true } }; if (runner.HasCustomArg("--extra-only")) { Console.WriteLine("Running only the tests marked as ExtraCoverage"); includeCategories.Add(Categories.ExtraCoverage); } else { excludeCategories.Add(Categories.ExtraCoverage); } GVFSTestConfig.FileSystemRunners = FileSystemRunners.FileSystemRunner.DefaultRunners; } if (runner.HasCustomArg("--windows-only")) { includeCategories.Add(Categories.WindowsOnly); // RunTests unions all includeCategories. Remove ExtraCoverage to // ensure that we only run tests flagged as WindowsOnly includeCategories.Remove(Categories.ExtraCoverage); } if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { excludeCategories.Add(Categories.MacTODO.FailsOnBuildAgent); excludeCategories.Add(Categories.MacTODO.NeedsNewFolderCreateNotification); excludeCategories.Add(Categories.MacTODO.M4); excludeCategories.Add(Categories.MacTODO.FlakyTest); excludeCategories.Add(Categories.WindowsOnly); } else { excludeCategories.Add(Categories.MacOnly); } GVFSTestConfig.RepoToClone = runner.GetCustomArgWithParam("--repo-to-clone") ?? Properties.Settings.Default.RepoToClone; RunBeforeAnyTests(); Environment.ExitCode = runner.RunTests(includeCategories, excludeCategories); RunAfterAllTests(); if (Debugger.IsAttached) { Console.WriteLine("Tests completed. Press Enter to exit."); Console.ReadLine(); } }
public static void Main(string[] args) { Properties.Settings.Default.Initialize(); NUnitRunner runner = new NUnitRunner(args); if (runner.HasCustomArg("--no-shared-gvfs-cache")) { Console.WriteLine("Running without a shared git object cache"); GVFSTestConfig.NoSharedCache = true; } if (runner.HasCustomArg("--test-gvfs-on-path")) { Console.WriteLine("Running tests against GVFS on path"); GVFSTestConfig.TestGVFSOnPath = true; } if (runner.HasCustomArg("--replace-inbox-projfs")) { Console.WriteLine("Tests will replace inbox ProjFS"); GVFSTestConfig.ReplaceInboxProjFS = true; } GVFSTestConfig.LocalCacheRoot = runner.GetCustomArgWithParam("--shared-gvfs-cache-root"); List <string> includeCategories = new List <string>(); List <string> excludeCategories = new List <string>(); if (runner.HasCustomArg("--full-suite")) { Console.WriteLine("Running the full suite of tests"); if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { GVFSTestConfig.FileSystemRunners = FileSystemRunners.FileSystemRunner.AllWindowsRunners; } else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { GVFSTestConfig.FileSystemRunners = FileSystemRunners.FileSystemRunner.AllMacRunners; } } else { excludeCategories.Add(Categories.FullSuiteOnly); GVFSTestConfig.FileSystemRunners = FileSystemRunners.FileSystemRunner.DefaultRunners; } if (runner.HasCustomArg("--windows-only")) { includeCategories.Add(Categories.Windows); } if (runner.HasCustomArg("--mac-only")) { includeCategories.Add(Categories.Mac.M1); includeCategories.Add(Categories.Mac.M2); excludeCategories.Add(Categories.Mac.M2TODO); excludeCategories.Add(Categories.Mac.M3); excludeCategories.Add(Categories.Mac.M4); excludeCategories.Add(Categories.Windows); } GVFSTestConfig.RepoToClone = runner.GetCustomArgWithParam("--repo-to-clone") ?? Properties.Settings.Default.RepoToClone; RunBeforeAnyTests(); Environment.ExitCode = runner.RunTests(includeCategories, excludeCategories); RunAfterAllTests(); if (Debugger.IsAttached) { Console.WriteLine("Tests completed. Press Enter to exit."); Console.ReadLine(); } }
public static void Main(string[] args) { Properties.Settings.Default.Initialize(); NUnitRunner runner = new NUnitRunner(args); if (runner.HasCustomArg("--no-shared-gvfs-cache")) { Console.WriteLine("Running without a shared git object cache"); GVFSTestConfig.NoSharedCache = true; } if (runner.HasCustomArg("--test-gvfs-on-path")) { Console.WriteLine("Running tests against GVFS on path"); GVFSTestConfig.TestGVFSOnPath = true; } if (runner.HasCustomArg("--replace-inbox-projfs")) { Console.WriteLine("Tests will replace inbox ProjFS"); GVFSTestConfig.ReplaceInboxProjFS = true; } GVFSTestConfig.LocalCacheRoot = runner.GetCustomArgWithParam("--shared-gvfs-cache-root"); HashSet <string> includeCategories = new HashSet <string>(); HashSet <string> excludeCategories = new HashSet <string>(); if (runner.HasCustomArg("--full-suite")) { Console.WriteLine("Running the full suite of tests"); List <object[]> modes = new List <object[]>(); foreach (Settings.ValidateWorkingTreeMode mode in Enum.GetValues(typeof(Settings.ValidateWorkingTreeMode))) { modes.Add(new object[] { mode }); } GVFSTestConfig.GitRepoTestsValidateWorkTree = modes.ToArray(); if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { GVFSTestConfig.FileSystemRunners = FileSystemRunners.FileSystemRunner.AllWindowsRunners; } else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { GVFSTestConfig.FileSystemRunners = FileSystemRunners.FileSystemRunner.AllMacRunners; } } else { Settings.ValidateWorkingTreeMode validateMode = Settings.ValidateWorkingTreeMode.Full; if (runner.HasCustomArg("--sparse-mode")) { validateMode = Settings.ValidateWorkingTreeMode.SparseMode; // Only test the git commands in sparse mode for splitting out tests in builds includeCategories.Add(Categories.GitCommands); } GVFSTestConfig.GitRepoTestsValidateWorkTree = new object[] { new object[] { validateMode }, }; if (runner.HasCustomArg("--extra-only")) { Console.WriteLine("Running only the tests marked as ExtraCoverage"); includeCategories.Add(Categories.ExtraCoverage); } else { excludeCategories.Add(Categories.ExtraCoverage); } GVFSTestConfig.FileSystemRunners = FileSystemRunners.FileSystemRunner.DefaultRunners; } if (runner.HasCustomArg("--windows-only")) { includeCategories.Add(Categories.WindowsOnly); // RunTests unions all includeCategories. Remove ExtraCoverage to // ensure that we only run tests flagged as WindowsOnly includeCategories.Remove(Categories.ExtraCoverage); } if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { excludeCategories.Add(Categories.MacTODO.NeedsNewFolderCreateNotification); excludeCategories.Add(Categories.MacTODO.NeedsGVFSConfig); excludeCategories.Add(Categories.MacTODO.NeedsServiceVerb); excludeCategories.Add(Categories.MacTODO.NeedsStatusCache); excludeCategories.Add(Categories.MacTODO.TestNeedsToLockFile); excludeCategories.Add(Categories.WindowsOnly); } else { excludeCategories.Add(Categories.MacOnly); } GVFSTestConfig.DotGVFSRoot = RuntimeInformation.IsOSPlatform(OSPlatform.Linux) ? ".vfsforgit" : ".gvfs"; GVFSTestConfig.RepoToClone = runner.GetCustomArgWithParam("--repo-to-clone") ?? Properties.Settings.Default.RepoToClone; RunBeforeAnyTests(); Environment.ExitCode = runner.RunTests(includeCategories, excludeCategories); if (Debugger.IsAttached) { Console.WriteLine("Tests completed. Press Enter to exit."); Console.ReadLine(); } }
public static void Main(string[] args) { Properties.Settings.Default.Initialize(); NUnitRunner runner = new NUnitRunner(args); runner.AddGlobalSetupIfNeeded("Scalar.FunctionalTests.GlobalSetup"); if (runner.HasCustomArg("--no-shared-scalar-cache")) { Console.WriteLine("Running without a shared git object cache"); ScalarTestConfig.NoSharedCache = true; } if (runner.HasCustomArg("--test-scalar-on-path")) { Console.WriteLine("Running tests against Scalar on path"); ScalarTestConfig.TestScalarOnPath = true; } string trace2Output = runner.GetCustomArgWithParam("--trace2-output"); if (trace2Output != null) { Console.WriteLine($"Sending trace2 output to {trace2Output}"); Environment.SetEnvironmentVariable("GIT_TRACE2_EVENT", trace2Output); } ScalarTestConfig.LocalCacheRoot = runner.GetCustomArgWithParam("--shared-scalar-cache-root"); HashSet <string> includeCategories = new HashSet <string>(); HashSet <string> excludeCategories = new HashSet <string>(); // Run all GitRepoTests with sparse mode ScalarTestConfig.GitRepoTestsValidateWorkTree = new object[] { new object[] { Settings.ValidateWorkingTreeMode.SparseMode }, }; if (runner.HasCustomArg("--full-suite")) { Console.WriteLine("Running the full suite of tests"); if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { ScalarTestConfig.FileSystemRunners = FileSystemRunners.FileSystemRunner.AllWindowsRunners; } else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { ScalarTestConfig.FileSystemRunners = FileSystemRunners.FileSystemRunner.AllMacRunners; } } else { if (runner.HasCustomArg("--extra-only")) { Console.WriteLine("Running only the tests marked as ExtraCoverage"); includeCategories.Add(Categories.ExtraCoverage); } else { excludeCategories.Add(Categories.ExtraCoverage); } ScalarTestConfig.FileSystemRunners = FileSystemRunners.FileSystemRunner.DefaultRunners; } if (runner.HasCustomArg("--windows-only")) { includeCategories.Add(Categories.WindowsOnly); // RunTests unions all includeCategories. Remove ExtraCoverage to // ensure that we only run tests flagged as WindowsOnly includeCategories.Remove(Categories.ExtraCoverage); } if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { excludeCategories.Add(Categories.MacTODO.NeedsScalarConfig); excludeCategories.Add(Categories.MacTODO.NeedsServiceVerb); excludeCategories.Add(Categories.MacTODO.TestNeedsToLockFile); excludeCategories.Add(Categories.WindowsOnly); } else { excludeCategories.Add(Categories.MacOnly); } // For now, run all of the tests not flagged as needing to be updated to work // with the non-virtualized solution excludeCategories.Add(Categories.NeedsUpdatesForNonVirtualizedMode); if (!RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { excludeCategories.Add(Categories.MacOnly); } ScalarTestConfig.RepoToClone = runner.GetCustomArgWithParam("--repo-to-clone") ?? Properties.Settings.Default.RepoToClone; RunBeforeAnyTests(); Environment.ExitCode = runner.RunTests(includeCategories, excludeCategories); try { // Shutdown the watchman server now that the tests are complete. // Allows deleting the unwatched directories. ProcessHelper.Run("watchman", "shudown-server"); } catch (Exception) { // This is non-critical, and watchman may not be installed. } if (Debugger.IsAttached) { Console.WriteLine("Tests completed. Press Enter to exit."); Console.ReadLine(); } }
public static void Main(string[] args) { Properties.Settings.Default.Initialize(); Console.WriteLine("Settings.Default.CurrentDirectory: {0}", Settings.Default.CurrentDirectory); Console.WriteLine("Settings.Default.PathToGit: {0}", Settings.Default.PathToGit); Console.WriteLine("Settings.Default.PathToGVFS: {0}", Settings.Default.PathToGVFS); Console.WriteLine("Settings.Default.PathToGVFSService: {0}", Settings.Default.PathToGVFSService); NUnitRunner runner = new NUnitRunner(args); runner.AddGlobalSetupIfNeeded("GVFS.FunctionalTests.GlobalSetup"); if (runner.HasCustomArg("--no-shared-gvfs-cache")) { Console.WriteLine("Running without a shared git object cache"); GVFSTestConfig.NoSharedCache = true; } if (runner.HasCustomArg("--replace-inbox-projfs")) { Console.WriteLine("Tests will replace inbox ProjFS"); GVFSTestConfig.ReplaceInboxProjFS = true; } GVFSTestConfig.LocalCacheRoot = runner.GetCustomArgWithParam("--shared-gvfs-cache-root"); HashSet <string> includeCategories = new HashSet <string>(); HashSet <string> excludeCategories = new HashSet <string>(); if (runner.HasCustomArg("--full-suite")) { Console.WriteLine("Running the full suite of tests"); List <object[]> modes = new List <object[]>(); foreach (Settings.ValidateWorkingTreeMode mode in Enum.GetValues(typeof(Settings.ValidateWorkingTreeMode))) { modes.Add(new object[] { mode }); } GVFSTestConfig.GitRepoTestsValidateWorkTree = modes.ToArray(); GVFSTestConfig.FileSystemRunners = FileSystemRunners.FileSystemRunner.AllWindowsRunners; } else { Settings.ValidateWorkingTreeMode validateMode = Settings.ValidateWorkingTreeMode.Full; if (runner.HasCustomArg("--sparse-mode")) { validateMode = Settings.ValidateWorkingTreeMode.SparseMode; // Only test the git commands in sparse mode for splitting out tests in builds includeCategories.Add(Categories.GitCommands); } GVFSTestConfig.GitRepoTestsValidateWorkTree = new object[] { new object[] { validateMode }, }; if (runner.HasCustomArg("--extra-only")) { Console.WriteLine("Running only the tests marked as ExtraCoverage"); includeCategories.Add(Categories.ExtraCoverage); } else { excludeCategories.Add(Categories.ExtraCoverage); } // If we're running in CI exclude tests that are currently // flakey or broken when run in a CI environment. if (runner.HasCustomArg("--ci")) { excludeCategories.Add(Categories.NeedsReactionInCI); } GVFSTestConfig.FileSystemRunners = FileSystemRunners.FileSystemRunner.DefaultRunners; } GVFSTestConfig.DotGVFSRoot = ".gvfs"; GVFSTestConfig.RepoToClone = runner.GetCustomArgWithParam("--repo-to-clone") ?? Properties.Settings.Default.RepoToClone; RunBeforeAnyTests(); Environment.ExitCode = runner.RunTests(includeCategories, excludeCategories); if (Debugger.IsAttached) { Console.WriteLine("Tests completed. Press Enter to exit."); Console.ReadLine(); } }