테스트 실행기의 DLL 호스트와 앱호스트를 구분함
- 작성자
- 코노모리 카논
- 작성 시각
- 커밋
81ebb2a2d11ebf0105ff039d8967965d767fbd1c- 부모
- 2fb087d
변경된 파일 5개
+86-7| @@ -131,5 +131,24 @@ | ||
| 131 | 131 | "scope": "6498a73c-b12c-4d6f-847e-75cf5e8c8a25 메시지로 별도 패치 전달 완료. 현재 파일에는 후속 플랫폼 계약 검사 변경도 포함됨", |
| 132 | 132 | "csharp_retest": "not_run by this reviewer" |
| 133 | 133 | }, |
| 134 | 삭제: "mount_contract_acceptance": "tests/extraction/folder_publication_review.json의 mount_contract_scenarios 참조. 정상 ext4 API 연결과 미실행 부정 조건을 별도로 기록함" | |
| 134 | 추가: "mount_contract_acceptance": "tests/extraction/folder_publication_review.json의 mount_contract_scenarios 참조. 정상 ext4 API 연결과 미실행 부정 조건을 별도로 기록함", | |
| 135 | 추가: "runner_portability_fix": { | |
| 136 | 추가: "source_message": "8f83790b-1ca6-4761-bdfe-e0c3076cf146", | |
| 137 | 추가: "baseline_head": "2fb087de2e2467db0fea9bce85aade5ac23fd2c1", | |
| 138 | 추가: "implementation": "TestWorkerLaunch가 현재 프로세스의 dotnet/dotnet.exe와 고정 테스트 앱호스트를 구분함. DLL 모드는 현재 muxer와 고정 출력 DLL을 사용하고 앱호스트 모드는 출력 폴더의 Worker 및 자기 앱을 무인수로 직접 실행함", | |
| 139 | 추가: "output_layout": "AppContext.BaseDirectory 바로 아래 Zipelo.RuntimeTests 및 Zipelo.Worker 파일과 필요한 deps/runtimeconfig/런타임 파일. 앱호스트 이름은 Windows에서만 .exe 확장자임. self-contained 검증 스냅샷에 Worker 게시 산출물을 함께 배치해야 함", | |
| 140 | 추가: "fail_closed": "누락 파일, 실행파일 링크 및 예상하지 못한 호스트는 오류임. PATH, 입력 ZIP 위치 또는 현재 작업 디렉터리에서 실행파일을 탐색하지 않음. SKIP이나 PASS로 치환하지 않음", | |
| 141 | 추가: "expectations": "기존 98개 등록과 제품 성공/실패/취소/보존 기대값을 유지함", | |
| 142 | 추가: "local_csharp": "not_run: local .NET SDK absent", | |
| 143 | 추가: "required_execution": [ | |
| 144 | 추가: "Windows DLL + dotnet host: 실제 Worker 목록/생성/해제 및 무인수 peer 오류/취소/종료 경계", | |
| 145 | 추가: "Linux self-contained apphost: 실제 Worker 목록/생성/해제 및 무인수 peer 오류/취소/종료 경계" | |
| 146 | 추가: ], | |
| 147 | 추가: "historical_ubuntu_report": "round6 + 타입 수정: 총괄 보고 Core41 통과, Runtime9 통과/39 실패/8 blocked. 앱호스트에 DLL 인수를 붙인 실행기 오류가 포함되어 39개를 제품 결함으로 계산하지 않음", | |
| 148 | 추가: "references": [ | |
| 149 | 추가: "https://learn.microsoft.com/en-us/dotnet/api/system.environment.processpath?view=net-10.0", | |
| 150 | 추가: "https://learn.microsoft.com/en-us/dotnet/core/deploying/", | |
| 151 | 추가: "https://learn.microsoft.com/en-us/dotnet/api/system.appcontext.basedirectory?view=net-10.0" | |
| 152 | 추가: ] | |
| 153 | 추가: } | |
| 135 | 154 | } |
| @@ -10,8 +10,7 @@ namespace Zipelo.RuntimeTests; | ||
| 10 | 10 | internal sealed partial class ExtractionTests(string root, string sandbox) |
| 11 | 11 | { |
| 12 | 12 | private static JobLimits Limits => new(32, 1024 * 1024, 1024 * 1024, TimeSpan.FromSeconds(15), 3); |
| 13 | 삭제: private static ZipWorkerClient Worker => new(Path.Combine(AppContext.BaseDirectory, "Zipelo.Worker.dll"), | |
| 14 | 삭제: Environment.ProcessPath ?? throw new InvalidOperationException()); | |
| 13 | 추가: private static ZipWorkerClient Worker => TestWorkerLaunch.Worker; | |
| 15 | 14 | |
| 16 | 15 | public IEnumerable<(string Name, Func<Task> Run)> Cases() |
| 17 | 16 | { |
| @@ -11,9 +11,8 @@ namespace Zipelo.RuntimeTests; | ||
| 11 | 11 | internal sealed partial class RuntimeTests(string root, string sandbox) |
| 12 | 12 | { |
| 13 | 13 | private static JobLimits Limits => new(32, 1024 * 1024, 1024 * 1024, TimeSpan.FromSeconds(15), 3); |
| 14 | 삭제: private static string Host => Environment.ProcessPath ?? throw new InvalidOperationException(); | |
| 15 | 삭제: private static ZipWorkerClient Worker => new(Path.Combine(AppContext.BaseDirectory, "Zipelo.Worker.dll"), Host); | |
| 16 | 삭제: private static ZipWorkerClient Peer => new(typeof(Program).Assembly.Location, Host); | |
| 14 | 추가: private static ZipWorkerClient Worker => TestWorkerLaunch.Worker; | |
| 15 | 추가: private static ZipWorkerClient Peer => TestWorkerLaunch.Peer; | |
| 17 | 16 | |
| 18 | 17 | public IEnumerable<(string Name, Func<Task> Run)> Cases() |
| 19 | 18 | { |
| @@ -62,7 +61,7 @@ internal sealed partial class RuntimeTests(string root, string sandbox) | ||
| 62 | 61 | Check.Throws<ArgumentException>(() => WorkerPlatform.GetWorkerPath("relative")); |
| 63 | 62 | var expected = OperatingSystem.IsWindows() ? "Zipelo.Worker.exe" : "Zipelo.Worker"; |
| 64 | 63 | Check.Equal(Path.Combine(sandbox, "worker", expected), WorkerPlatform.GetWorkerPath(sandbox)); |
| 65 | 삭제: var missing = new ZipWorkerClient(Path.Combine(sandbox, "absent-worker.dll"), Host); | |
| 64 | 추가: var missing = new ZipWorkerClient(Path.Combine(sandbox, "absent-worker.dll"), TestWorkerLaunch.DotnetHost); | |
| 66 | 65 | Check.That(!missing.IsAvailable && missing.Capabilities.Count == 0, "없는 작업자를 사용 가능으로 표시함"); |
| 67 | 66 | Check.That(!Worker.SupportsSafeExtraction && !Worker.SupportsEncryption && !Worker.SupportsSplitVolumes, |
| 68 | 67 | "미구현 기능을 사용 가능으로 표시함"); |
| @@ -0,0 +1,61 @@ | ||
| 1 | 추가: using Zipelo.Runtime; | |
| 2 | 추가: | |
| 3 | 추가: namespace Zipelo.RuntimeTests; | |
| 4 | 추가: | |
| 5 | 추가: internal static class TestWorkerLaunch | |
| 6 | 추가: { | |
| 7 | 추가: private static string ExecutableSuffix => OperatingSystem.IsWindows() ? ".exe" : ""; | |
| 8 | 추가: private static StringComparison PathComparison => OperatingSystem.IsWindows() | |
| 9 | 추가: ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal; | |
| 10 | 추가: | |
| 11 | 추가: public static ZipWorkerClient Worker => Create("Zipelo.Worker"); | |
| 12 | 추가: public static ZipWorkerClient Peer => Create("Zipelo.RuntimeTests"); | |
| 13 | 추가: | |
| 14 | 추가: public static string? DotnetHost | |
| 15 | 추가: { | |
| 16 | 추가: get | |
| 17 | 추가: { | |
| 18 | 추가: var processPath = Environment.ProcessPath; | |
| 19 | 추가: if (processPath is null || !Path.IsPathFullyQualified(processPath) || !File.Exists(processPath)) | |
| 20 | 추가: { | |
| 21 | 추가: throw new InvalidOperationException("현재 테스트 실행파일의 절대 경로를 확인할 수 없음"); | |
| 22 | 추가: } | |
| 23 | 추가: | |
| 24 | 추가: // 현재 실행 중인 muxer만 재사용하며 PATH에서 호스트를 찾지 않음. | |
| 25 | 추가: if (string.Equals(Path.GetFileName(processPath), "dotnet" + ExecutableSuffix, PathComparison)) | |
| 26 | 추가: { | |
| 27 | 추가: if (!string.Equals(typeof(Program).Assembly.Location, | |
| 28 | 추가: OutputFile("Zipelo.RuntimeTests.dll"), PathComparison)) | |
| 29 | 추가: { | |
| 30 | 추가: throw new InvalidOperationException("테스트 DLL이 고정 출력 폴더와 일치하지 않음"); | |
| 31 | 추가: } | |
| 32 | 추가: return processPath; | |
| 33 | 추가: } | |
| 34 | 추가: | |
| 35 | 추가: if (!string.Equals(processPath, OutputFile("Zipelo.RuntimeTests" + ExecutableSuffix), PathComparison)) | |
| 36 | 추가: { | |
| 37 | 추가: throw new InvalidOperationException("알 수 없는 테스트 앱호스트임"); | |
| 38 | 추가: } | |
| 39 | 추가: return null; | |
| 40 | 추가: } | |
| 41 | 추가: } | |
| 42 | 추가: | |
| 43 | 추가: private static ZipWorkerClient Create(string name) | |
| 44 | 추가: { | |
| 45 | 추가: var host = DotnetHost; | |
| 46 | 추가: var path = OutputFile(name + (host is null ? ExecutableSuffix : ".dll")); | |
| 47 | 추가: // 앱호스트에는 DLL 인수를 붙이지 않아 자기 앱의 무인수 peer 모드를 유지함. | |
| 48 | 추가: return new ZipWorkerClient(path, host); | |
| 49 | 추가: } | |
| 50 | 추가: | |
| 51 | 추가: private static string OutputFile(string name) | |
| 52 | 추가: { | |
| 53 | 추가: var path = Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, name)); | |
| 54 | 추가: if (!File.Exists(path)) { throw new FileNotFoundException("필수 테스트 출력 파일이 없음", path); } | |
| 55 | 추가: if ((File.GetAttributes(path) & (FileAttributes.Directory | FileAttributes.ReparsePoint)) != 0) | |
| 56 | 추가: { | |
| 57 | 추가: throw new InvalidOperationException("테스트 출력 실행파일의 링크를 허용하지 않음"); | |
| 58 | 추가: } | |
| 59 | 추가: return path; | |
| 60 | 추가: } | |
| 61 | 추가: } |
| @@ -10,6 +10,7 @@ | ||
| 10 | 10 | <ItemGroup> |
| 11 | 11 | <Compile Include="Program.cs" /> |
| 12 | 12 | <Compile Include="RuntimeTests.cs" /> |
| 13 | 추가: <Compile Include="TestWorkerLaunch.cs" /> | |
| 13 | 14 | <Compile Include="PublicationTests.cs" /> |
| 14 | 15 | <Compile Include="ExtractionTests.cs" /> |
| 15 | 16 | <Compile Include="ExtractionPublicationTests.cs" /> |