team-ljyzipelo

공개

테스트 실행기의 DLL 호스트와 앱호스트를 구분함

작성자
코노모리 카논
작성 시각
커밋
81ebb2a2d11ebf0105ff039d8967965d767fbd1c
부모
2fb087d
이 시점의 파일 보기

변경된 파일 5개

+86-7
수정tests/extraction/coverage.json+20-1
@@ -131,5 +131,24 @@
131131 "scope": "6498a73c-b12c-4d6f-847e-75cf5e8c8a25 메시지로 별도 패치 전달 완료. 현재 파일에는 후속 플랫폼 계약 검사 변경도 포함됨",
132132 "csharp_retest": "not_run by this reviewer"
133133 },
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추가: }
135154}
수정tests/runtime/ExtractionTests.cs+1-2
@@ -10,8 +10,7 @@ namespace Zipelo.RuntimeTests;
1010internal sealed partial class ExtractionTests(string root, string sandbox)
1111{
1212 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;
1514
1615 public IEnumerable<(string Name, Func<Task> Run)> Cases()
1716 {
수정tests/runtime/RuntimeTests.cs+3-4
@@ -11,9 +11,8 @@ namespace Zipelo.RuntimeTests;
1111internal sealed partial class RuntimeTests(string root, string sandbox)
1212{
1313 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;
1716
1817 public IEnumerable<(string Name, Func<Task> Run)> Cases()
1918 {
@@ -62,7 +61,7 @@ internal sealed partial class RuntimeTests(string root, string sandbox)
6261 Check.Throws<ArgumentException>(() => WorkerPlatform.GetWorkerPath("relative"));
6362 var expected = OperatingSystem.IsWindows() ? "Zipelo.Worker.exe" : "Zipelo.Worker";
6463 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);
6665 Check.That(!missing.IsAvailable && missing.Capabilities.Count == 0, "없는 작업자를 사용 가능으로 표시함");
6766 Check.That(!Worker.SupportsSafeExtraction && !Worker.SupportsEncryption && !Worker.SupportsSplitVolumes,
6867 "미구현 기능을 사용 가능으로 표시함");
추가tests/runtime/TestWorkerLaunch.cs+61-0
@@ -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추가: }
수정tests/runtime/Zipelo.RuntimeTests.csproj+1-0
@@ -10,6 +10,7 @@
1010 <ItemGroup>
1111 <Compile Include="Program.cs" />
1212 <Compile Include="RuntimeTests.cs" />
13추가: <Compile Include="TestWorkerLaunch.cs" />
1314 <Compile Include="PublicationTests.cs" />
1415 <Compile Include="ExtractionTests.cs" />
1516 <Compile Include="ExtractionPublicationTests.cs" />