| ... | ... | @@ -55,9 +55,24 @@ const zipFixtures = { |
| 55 | 55 | "UEsDBBQAAAAIAAAAIl1zEy/oFAAAABQAAAASAAAAYWd5X2FjcF9zZXJ2ZXIuZXhlS8wryUwvSizLLKlUKCoFcnJTuQBQSwMEFAAAAAgAAAAiXV9yAykQAAAADgAAABkAAABsb2NhbGhhcm5lc3NfZXh0ZXJuYWwuZXhly8lPTsxRyEgsykstLuYCAFBLAQIUAxQAAAAIAAAAIl1zEy/oFAAAABQAAAASAAAAAAAAAAAAAADtgQAAAABhZ3lfYWNwX3NlcnZlci5leGVQSwECFAMUAAAACAAAACJdX3IDKRAAAAAOAAAAGQAAAAAAAAAAAAAA7YFEAAAAbG9jYWxoYXJuZXNzX2V4dGVybmFsLmV4ZVBLBQYAAAAAAgACAIcAAACLAAAAAAA=", |
| 56 | 56 | }; |
| 57 | 57 | |
| 58 | | const completeArchive = Buffer.from(zipFixtures.complete, "base64"); |
| 58 | // The installation checks POSIX exec bits off the real filesystem unless the |
| 59 | // platform is win32, so a linux platform mock cannot pass on NTFS. Default to |
| 60 | // the host and let the fixture names follow; the suite is about install |
| 61 | // mechanics, which are the same on every platform. |
| 62 | const hostPlatform: NodeJS.Platform = |
| 63 | HostProcessPlatform.defaultValue() === "win32" ? "win32" : "linux"; |
| 64 | const completeArchive = Buffer.from( |
| 65 | hostPlatform === "win32" ? zipFixtures.windows : zipFixtures.complete, |
| 66 | "base64", |
| 67 | ); |
| 68 | const executableName = hostPlatform === "win32" ? "agy_acp_server.exe" : "agy_acp_server.par"; |
| 69 | const harnessName = |
| 70 | hostPlatform === "win32" ? "localharness_external.exe" : "localharness_external"; |
| 59 | 71 | |
| 60 | | function releaseAsset(archive: Uint8Array = completeArchive, platform: NodeJS.Platform = "linux") { |
| 72 | function releaseAsset( |
| 73 | archive: Uint8Array = completeArchive, |
| 74 | platform: NodeJS.Platform = hostPlatform, |
| 75 | ) { |
| 61 | 76 | return { |
| 62 | 77 | version: "fixture-new", |
| 63 | 78 | url: "https://dl.google.com/antigravity-test.zip", |
| ... | ... | @@ -128,7 +143,7 @@ const makeHarness = Effect.fn("test.makeAntigravityInstallation")(function* ( |
| 128 | 143 | const path = yield* Path.Path; |
| 129 | 144 | const baseDir = |
| 130 | 145 | options.baseDir ?? (yield* fs.makeTempDirectoryScoped({ prefix: "t3-agy-test-" })); |
| 131 | | const platform = options.platform ?? "linux"; |
| 146 | const platform = options.platform ?? hostPlatform; |
| 132 | 147 | const archive = options.archive ?? completeArchive; |
| 133 | 148 | const asset = options.asset === undefined ? releaseAsset(archive, platform) : options.asset; |
| 134 | 149 | const managedDirectory = path.join(baseDir, "tools", "antigravity-acp", `${platform}-x64`); |
| ... | ... | @@ -472,7 +487,7 @@ it.layer(NodeServices.layer)("Antigravity installation", (it) => { |
| 472 | 487 | ...fs, |
| 473 | 488 | sink: (target, options) => |
| 474 | 489 | (stage === "download" && target.endsWith("download.zip")) || |
| 475 | | (stage === "extract" && target.endsWith("agy_acp_server.par")) |
| 490 | (stage === "extract" && target.endsWith(executableName)) |
| 476 | 491 | ? fs.sink(target, options).pipe(Sink.mapInputEffect(() => Effect.fail(noSpace))) |
| 477 | 492 | : fs.sink(target, options), |
| 478 | 493 | writeFileString: (target, content, options) => |
| ... | ... | @@ -525,7 +540,7 @@ it.layer(NodeServices.layer)("Antigravity installation", (it) => { |
| 525 | 540 | fileSystem: FileSystem.FileSystem.of({ |
| 526 | 541 | ...fs, |
| 527 | 542 | sink: (target, options) => |
| 528 | | phase === "extracting" && target.endsWith("agy_acp_server.par") |
| 543 | phase === "extracting" && target.endsWith(executableName) |
| 529 | 544 | ? fs |
| 530 | 545 | .sink(target, options) |
| 531 | 546 | .pipe( |
| ... | ... | @@ -691,8 +706,8 @@ it.layer(NodeServices.layer)("Antigravity installation", (it) => { |
| 691 | 706 | const path = yield* Path.Path; |
| 692 | 707 | const baseDir = yield* fs.makeTempDirectoryScoped({ prefix: "t3-agy-path-test-" }); |
| 693 | 708 | const externalDirectory = path.join(baseDir, "external"); |
| 694 | | const externalExecutable = path.join(externalDirectory, "agy_acp_server.par"); |
| 695 | | const externalHarness = path.join(externalDirectory, "localharness_external"); |
| 709 | const externalExecutable = path.join(externalDirectory, executableName); |
| 710 | const externalHarness = path.join(externalDirectory, harnessName); |
| 696 | 711 | yield* fs.makeDirectory(externalDirectory); |
| 697 | 712 | yield* fs.writeFileString(externalExecutable, "external server", { mode: 0o755 }); |
| 698 | 713 | yield* fs.writeFileString(externalHarness, "external harness", { mode: 0o755 }); |
| ... | ... | @@ -711,7 +726,7 @@ it.layer(NodeServices.layer)("Antigravity installation", (it) => { |
| 711 | 726 | source: "override", |
| 712 | 727 | managedVersionDirectory: null, |
| 713 | 728 | }); |
| 714 | | expect(yield* installation.resolve("agy_acp_server.par")).toMatchObject({ |
| 729 | expect(yield* installation.resolve(executableName)).toMatchObject({ |
| 715 | 730 | source: "override", |
| 716 | 731 | }); |
| 717 | 732 | yield* fs.remove(externalHarness); |
| ... | ... | @@ -741,7 +756,7 @@ it.layer(NodeServices.layer)("Antigravity installation", (it) => { |
| 741 | 756 | executablePath: externalExecutable, |
| 742 | 757 | }); |
| 743 | 758 | expect( |
| 744 | | yield* isolated.installation.resolve("agy_acp_server.par", { PATH: externalDirectory }), |
| 759 | yield* isolated.installation.resolve(executableName, { PATH: externalDirectory }), |
| 745 | 760 | ).toMatchObject({ source: "override", executablePath: externalExecutable }); |
| 746 | 761 | }), |
| 747 | 762 | ); |
| ... | ... | @@ -774,20 +789,12 @@ it.layer(NodeServices.layer)("Antigravity installation", (it) => { |
| 774 | 789 | yield* fs.remove(previous.harnessPath); |
| 775 | 790 | const externalDirectory = path.join(baseDir, "external"); |
| 776 | 791 | yield* fs.makeDirectory(externalDirectory); |
| 777 | | yield* fs.writeFileString( |
| 778 | | path.join(externalDirectory, "agy_acp_server.par"), |
| 779 | | "external server", |
| 780 | | { |
| 781 | | mode: 0o755, |
| 782 | | }, |
| 783 | | ); |
| 784 | | yield* fs.writeFileString( |
| 785 | | path.join(externalDirectory, "localharness_external"), |
| 786 | | "external harness", |
| 787 | | { |
| 788 | | mode: 0o755, |
| 789 | | }, |
| 790 | | ); |
| 792 | yield* fs.writeFileString(path.join(externalDirectory, executableName), "external server", { |
| 793 | mode: 0o755, |
| 794 | }); |
| 795 | yield* fs.writeFileString(path.join(externalDirectory, harnessName), "external harness", { |
| 796 | mode: 0o755, |
| 797 | }); |
| 791 | 798 | const restarted = yield* makeHarness({ baseDir, path: externalDirectory }); |
| 792 | 799 | expect(yield* restarted.installation.state).toMatchObject({ |
| 793 | 800 | phase: "failed", |
| ... | ... | @@ -824,8 +831,8 @@ it.layer(NodeServices.layer)("Antigravity installation", (it) => { |
| 824 | 831 | const profileDirectory = path.join(baseDir, "providers", "antigravity", "profile"); |
| 825 | 832 | yield* fs.makeDirectory(externalDirectory); |
| 826 | 833 | yield* fs.makeDirectory(profileDirectory, { recursive: true }); |
| 827 | | const externalExecutable = path.join(externalDirectory, "agy_acp_server.par"); |
| 828 | | const externalHarness = path.join(externalDirectory, "localharness_external"); |
| 834 | const externalExecutable = path.join(externalDirectory, executableName); |
| 835 | const externalHarness = path.join(externalDirectory, harnessName); |
| 829 | 836 | const profilePath = path.join(profileDirectory, "preferences.json"); |
| 830 | 837 | yield* fs.writeFileString(externalExecutable, "external server", { mode: 0o755 }); |
| 831 | 838 | yield* fs.writeFileString(externalHarness, "external harness", { mode: 0o755 }); |