fix(tests): the launcher/headless command-line contract needs executable stubs on Linux
Run 173's Linux job failed on the contract test added one commit earlier — my test, not the product. LauncherExecutableSet refuses a host that exists but has no execute bit on Linux (HasUnixExecutePermission), which is a real and useful check: an update whose extraction lost its permissions would otherwise fail deep inside process start instead of at the launch gate. The stubs were written with File.WriteAllText, which is 0644, so on Linux every one of the four tests died at that gate before reaching the command-line contract they exist to pin. Windows never sees this — the predicate short-circuits to true off Linux — so the test passed locally and could only fail on the runner. Stubs are now created through a helper that chmods them executable on non- Windows. Verified on Windows (4 passed); the Linux half is what run 174 checks. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
6ab5d8ce0f
commit
d233538f2c
1 changed files with 22 additions and 2 deletions
|
|
@ -32,8 +32,28 @@ public sealed class LauncherHeadlessCommandLineContractTests : IDisposable
|
|||
// the contract can only be exercised against files that exist.
|
||||
Directory.CreateDirectory(AppDirectory);
|
||||
string suffix = OperatingSystem.IsWindows() ? ".exe" : string.Empty;
|
||||
File.WriteAllText(Path.Combine(AppDirectory, "AcDream.App" + suffix), "stub");
|
||||
File.WriteAllText(Path.Combine(AppDirectory, "acdream-headless" + suffix), "stub");
|
||||
CreateStubExecutable(Path.Combine(AppDirectory, "AcDream.App" + suffix));
|
||||
CreateStubExecutable(Path.Combine(AppDirectory, "acdream-headless" + suffix));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// On Linux the spec builders also refuse a host that exists but has no
|
||||
/// execute bit — a real check, since an extracted update that lost its
|
||||
/// permissions would otherwise fail deep inside process start. A stub
|
||||
/// written with WriteAllText is 0644, so it has to be made executable for
|
||||
/// the command-line contract underneath to be reachable at all.
|
||||
/// </summary>
|
||||
private static void CreateStubExecutable(string path)
|
||||
{
|
||||
File.WriteAllText(path, "stub");
|
||||
if (!OperatingSystem.IsWindows())
|
||||
{
|
||||
File.SetUnixFileMode(
|
||||
path,
|
||||
UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.UserExecute
|
||||
| UnixFileMode.GroupRead | UnixFileMode.GroupExecute
|
||||
| UnixFileMode.OtherRead | UnixFileMode.OtherExecute);
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue