public DeleteEmptyFolderTests(Settings.ValidateWorkingTreeMode validateWorkingTree)
     : base(enlistmentPerTest: true, validateWorkingTree: validateWorkingTree)
 {
 }
Beispiel #2
0
 public CreatePlaceholderTests(Settings.ValidateWorkingTreeMode validateWorkingTree)
     : base(enlistmentPerTest: true, validateWorkingTree: validateWorkingTree)
 {
 }
Beispiel #3
0
 public GitRepoTests(bool enlistmentPerTest, Settings.ValidateWorkingTreeMode validateWorkingTree)
 {
     this.enlistmentPerTest   = enlistmentPerTest;
     this.validateWorkingTree = validateWorkingTree;
     this.FileSystem          = new SystemIORunner();
 }
Beispiel #4
0
 public CheckoutTests(Settings.ValidateWorkingTreeMode validateWorkingTree)
     : base(enlistmentPerTest: true, validateWorkingTree: validateWorkingTree)
 {
 }
 public MergeConflictTests(Settings.ValidateWorkingTreeMode validateWorkingTree)
     : base(enlistmentPerTest: true, validateWorkingTree: validateWorkingTree)
 {
 }
Beispiel #6
0
 public ResetMixedTests(Settings.ValidateWorkingTreeMode validateWorkingTree)
     : base(enlistmentPerTest: true, validateWorkingTree: validateWorkingTree)
 {
 }
Beispiel #7
0
 public AddStageTests(Settings.ValidateWorkingTreeMode validateWorkingTree)
     : base(enlistmentPerTest: false, validateWorkingTree: validateWorkingTree)
 {
 }
Beispiel #8
0
        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();
            }
        }
Beispiel #9
0
 public UpdateIndexTests(Settings.ValidateWorkingTreeMode validateWorkingTree)
     : base(enlistmentPerTest: true, validateWorkingTree: validateWorkingTree)
 {
 }
Beispiel #10
0
 public EnumerationMergeTest(Settings.ValidateWorkingTreeMode validateWorkingTree)
     : base(enlistmentPerTest: true, validateWorkingTree: validateWorkingTree)
 {
 }
Beispiel #11
0
        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();
            }
        }