Skip to content

Commit 141d39a

Browse files
committed
Remove GVFS.Service from installer and payload
Installer (Setup.iss): - Stop and delete GVFS.Service on upgrade from old version - Register \GVFS\AutoMount logon task for auto-mount at logon - Remove service deployment, install, and startup [Files]/[Run] entries - Remove PendingUpgrade staging logic and ShowMountChoiceDialog (~280 lines) - Remove MountRepos/UnmountRepos (depended on service) - Keep StopService/UninstallService for migration from old versions Payload (layout.bat): - Exclude GVFS.Service.exe from installer payload Functional tests: - Add --no-service flag: skips service install/uninstall - Add Categories.RequiresService: auto-excluded when --no-service - Tag ServiceVerbTests, ServiceTests, UpgradeReminderTests - Settings.cs: auto-detect user-mode install at %LocalAppData% Assisted-by: Claude Sonnet 4.5 Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
1 parent 3660ff3 commit 141d39a

10 files changed

Lines changed: 447 additions & 356 deletions

File tree

GVFS/GVFS.FunctionalTests/Categories.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
{
33
public static class Categories
44
{
5+
public const string ExtraCoverage = "ExtraCoverage";
56
public const string FastFetch = "FastFetch";
67
public const string GitCommands = "GitCommands";
7-
public const string SkipInCI = "SkipInCI";
8+
public const string NeedsReactionInCI = "NeedsReactionInCI";
9+
public const string RequiresService = "RequiresService";
810
}
911
}

GVFS/GVFS.FunctionalTests/GVFSTestConfig.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ public static class GVFSTestConfig
1818

1919
public static bool IsDevMode { get; set; }
2020

21+
public static bool NoService { get; set; }
22+
2123
public static string PathToGVFS
2224
{
2325
get

GVFS/GVFS.FunctionalTests/GlobalSetup.cs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,22 @@ public void RunAfterAllTests()
2020
{
2121
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
2222
{
23-
string serviceLogFolder = Path.Combine(
24-
Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData),
25-
"GVFS",
26-
GVFSServiceProcess.TestServiceName,
27-
"Logs");
28-
29-
Console.WriteLine("GVFS.Service logs at '{0}' attached below.\n\n", serviceLogFolder);
30-
foreach (string filename in TestResultsHelper.GetAllFilesInDirectory(serviceLogFolder))
23+
if (!GVFSTestConfig.NoService)
3124
{
32-
TestResultsHelper.OutputFileContents(filename);
33-
}
25+
string serviceLogFolder = Path.Combine(
26+
Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData),
27+
"GVFS",
28+
GVFSServiceProcess.TestServiceName,
29+
"Logs");
3430

35-
GVFSServiceProcess.UninstallService();
31+
Console.WriteLine("GVFS.Service logs at '{0}' attached below.\n\n", serviceLogFolder);
32+
foreach (string filename in TestResultsHelper.GetAllFilesInDirectory(serviceLogFolder))
33+
{
34+
TestResultsHelper.OutputFileContents(filename);
35+
}
36+
37+
GVFSServiceProcess.UninstallService();
38+
}
3639
}
3740

3841
PrintTestCaseStats.PrintRunTimeStats();

GVFS/GVFS.FunctionalTests/Program.cs

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,22 @@ public static void Main(string[] args)
4848
GVFSTestConfig.ReplaceInboxProjFS = true;
4949
}
5050

51+
if (runner.HasCustomArg("--no-service"))
52+
{
53+
Console.WriteLine("Running in no-service mode (user-level install model)");
54+
GVFSTestConfig.NoService = true;
55+
}
56+
5157
GVFSTestConfig.LocalCacheRoot = runner.GetCustomArgWithParam("--shared-gvfs-cache-root");
5258

5359
HashSet<string> includeCategories = new HashSet<string>();
5460
HashSet<string> excludeCategories = new HashSet<string>();
5561

62+
if (GVFSTestConfig.NoService)
63+
{
64+
excludeCategories.Add(Categories.RequiresService);
65+
}
66+
5667
if (runner.HasCustomArg("--full-suite"))
5768
{
5869
Console.WriteLine("Running the full suite of tests");
@@ -84,11 +95,21 @@ public static void Main(string[] args)
8495
new object[] { validateMode },
8596
};
8697

98+
if (runner.HasCustomArg("--extra-only"))
99+
{
100+
Console.WriteLine("Running only the tests marked as ExtraCoverage");
101+
includeCategories.Add(Categories.ExtraCoverage);
102+
}
103+
else
104+
{
105+
excludeCategories.Add(Categories.ExtraCoverage);
106+
}
107+
87108
// If we're running in CI exclude tests that are currently
88109
// flakey or broken when run in a CI environment.
89110
if (runner.HasCustomArg("--ci"))
90111
{
91-
excludeCategories.Add(Categories.SkipInCI);
112+
excludeCategories.Add(Categories.NeedsReactionInCI);
92113
}
93114

94115
GVFSTestConfig.FileSystemRunners = FileSystemRunners.FileSystemRunner.DefaultRunners;
@@ -141,11 +162,19 @@ private static void RunBeforeAnyTests()
141162
ProjFSFilterInstaller.ReplaceInboxProjFS();
142163
}
143164

144-
Console.WriteLine("[CI-DEBUG] Installing service...");
145-
Console.Out.Flush();
146-
GVFSServiceProcess.InstallService();
147-
Console.WriteLine("[CI-DEBUG] Service installed successfully");
148-
Console.Out.Flush();
165+
if (!GVFSTestConfig.NoService)
166+
{
167+
Console.WriteLine("[CI-DEBUG] Installing service...");
168+
Console.Out.Flush();
169+
GVFSServiceProcess.InstallService();
170+
Console.WriteLine("[CI-DEBUG] Service installed successfully");
171+
Console.Out.Flush();
172+
}
173+
else
174+
{
175+
Console.WriteLine("[CI-DEBUG] Skipping service install (--no-service mode)");
176+
Console.Out.Flush();
177+
}
149178

150179
string serviceProgramDataDir = GVFSPlatform.Instance.GetSecureDataRootForGVFSComponent(
151180
GVFSConstants.Service.ServiceName);

GVFS/GVFS.FunctionalTests/Settings.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,20 @@ public static void Initialize()
6565
}
6666
else
6767
{
68-
PathToGVFS = @"C:\Program Files\VFS for Git\GVFS.exe";
69-
PathToGVFSService = @"C:\Program Files\VFS for Git\GVFS.Service.exe";
68+
// User-level install path (LocalAppData) for user-mode testing.
69+
string userLevelGvfs = Path.Combine(
70+
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
71+
"VFSForGit", "Current", "gvfs.exe");
72+
if (File.Exists(userLevelGvfs))
73+
{
74+
PathToGVFS = userLevelGvfs;
75+
PathToGVFSService = Path.Combine(Path.GetDirectoryName(userLevelGvfs), "GVFS.Service.exe");
76+
}
77+
else
78+
{
79+
PathToGVFS = @"C:\Program Files\VFS for Git\GVFS.exe";
80+
PathToGVFSService = @"C:\Program Files\VFS for Git\GVFS.Service.exe";
81+
}
7082
}
7183

7284
PathToGit = @"C:\Program Files\Git\cmd\git.exe";

0 commit comments

Comments
 (0)