| ... | @@ -55,9 +55,24 @@ const zipFixtures = { | ... | @@ -55,9 +55,24 @@ const zipFixtures = { |
| 55 | "UEsDBBQAAAAIAAAAIl1zEy/oFAAAABQAAAASAAAAYWd5X2FjcF9zZXJ2ZXIuZXhlS8wryUwvSizLLKlUKCoFcnJTuQBQSwMEFAAAAAgAAAAiXV9yAykQAAAADgAAABkAAABsb2NhbGhhcm5lc3NfZXh0ZXJuYWwuZXhly8lPTsxRyEgsykstLuYCAFBLAQIUAxQAAAAIAAAAIl1zEy/oFAAAABQAAAASAAAAAAAAAAAAAADtgQAAAABhZ3lfYWNwX3NlcnZlci5leGVQSwECFAMUAAAACAAAACJdX3IDKRAAAAAOAAAAGQAAAAAAAAAAAAAA7YFEAAAAbG9jYWxoYXJuZXNzX2V4dGVybmFsLmV4ZVBLBQYAAAAAAgACAIcAAACLAAAAAAA=", | 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 | return { | 76 | return { |
| 62 | version: "fixture-new", | 77 | version: "fixture-new", |
| 63 | url: "https://dl.google.com/antigravity-test.zip", | 78 | url: "https://dl.google.com/antigravity-test.zip", |
| ... | @@ -128,7 +143,7 @@ const makeHarness = Effect.fn("test.makeAntigravityInstallation")(function* ( | ... | @@ -128,7 +143,7 @@ const makeHarness = Effect.fn("test.makeAntigravityInstallation")(function* ( |
| 128 | const path = yield* Path.Path; | 143 | const path = yield* Path.Path; |
| 129 | const baseDir = | 144 | const baseDir = |
| 130 | options.baseDir ?? (yield* fs.makeTempDirectoryScoped({ prefix: "t3-agy-test-" })); | 145 | options.baseDir ?? (yield* fs.makeTempDirectoryScoped({ prefix: "t3-agy-test-" })); |
| 131 | const platform = options.platform ?? "linux"; | 146 | const platform = options.platform ?? hostPlatform; |
| 132 | const archive = options.archive ?? completeArchive; | 147 | const archive = options.archive ?? completeArchive; |
| 133 | const asset = options.asset === undefined ? releaseAsset(archive, platform) : options.asset; | 148 | const asset = options.asset === undefined ? releaseAsset(archive, platform) : options.asset; |
| 134 | const managedDirectory = path.join(baseDir, "tools", "antigravity-acp", `${platform}-x64`); | 149 | const managedDirectory = path.join(baseDir, "tools", "antigravity-acp", `${platform}-x64`); |
| ... | @@ -472,7 +487,7 @@ it.layer(NodeServices.layer)("Antigravity installation", (it) => { | ... | @@ -472,7 +487,7 @@ it.layer(NodeServices.layer)("Antigravity installation", (it) => { |
| 472 | ...fs, | 487 | ...fs, |
| 473 | sink: (target, options) => | 488 | sink: (target, options) => |
| 474 | (stage === "download" && target.endsWith("download.zip")) || | 489 | (stage === "download" && target.endsWith("download.zip")) || |
| 475 | (stage === "extract" && target.endsWith("agy_acp_server.par")) | 490 | (stage === "extract" && target.endsWith(executableName)) |
| 476 | ? fs.sink(target, options).pipe(Sink.mapInputEffect(() => Effect.fail(noSpace))) | 491 | ? fs.sink(target, options).pipe(Sink.mapInputEffect(() => Effect.fail(noSpace))) |
| 477 | : fs.sink(target, options), | 492 | : fs.sink(target, options), |
| 478 | writeFileString: (target, content, options) => | 493 | writeFileString: (target, content, options) => |
| ... | @@ -525,7 +540,7 @@ it.layer(NodeServices.layer)("Antigravity installation", (it) => { | ... | @@ -525,7 +540,7 @@ it.layer(NodeServices.layer)("Antigravity installation", (it) => { |
| 525 | fileSystem: FileSystem.FileSystem.of({ | 540 | fileSystem: FileSystem.FileSystem.of({ |
| 526 | ...fs, | 541 | ...fs, |
| 527 | sink: (target, options) => | 542 | sink: (target, options) => |
| 528 | phase === "extracting" && target.endsWith("agy_acp_server.par") | 543 | phase === "extracting" && target.endsWith(executableName) |
| 529 | ? fs | 544 | ? fs |
| 530 | .sink(target, options) | 545 | .sink(target, options) |
| 531 | .pipe( | 546 | .pipe( |
| ... | @@ -691,8 +706,8 @@ it.layer(NodeServices.layer)("Antigravity installation", (it) => { | ... | @@ -691,8 +706,8 @@ it.layer(NodeServices.layer)("Antigravity installation", (it) => { |
| 691 | const path = yield* Path.Path; | 706 | const path = yield* Path.Path; |
| 692 | const baseDir = yield* fs.makeTempDirectoryScoped({ prefix: "t3-agy-path-test-" }); | 707 | const baseDir = yield* fs.makeTempDirectoryScoped({ prefix: "t3-agy-path-test-" }); |
| 693 | const externalDirectory = path.join(baseDir, "external"); | 708 | const externalDirectory = path.join(baseDir, "external"); |
| 694 | const externalExecutable = path.join(externalDirectory, "agy_acp_server.par"); | 709 | const externalExecutable = path.join(externalDirectory, executableName); |
| 695 | const externalHarness = path.join(externalDirectory, "localharness_external"); | 710 | const externalHarness = path.join(externalDirectory, harnessName); |
| 696 | yield* fs.makeDirectory(externalDirectory); | 711 | yield* fs.makeDirectory(externalDirectory); |
| 697 | yield* fs.writeFileString(externalExecutable, "external server", { mode: 0o755 }); | 712 | yield* fs.writeFileString(externalExecutable, "external server", { mode: 0o755 }); |
| 698 | yield* fs.writeFileString(externalHarness, "external harness", { mode: 0o755 }); | 713 | yield* fs.writeFileString(externalHarness, "external harness", { mode: 0o755 }); |
| ... | @@ -711,7 +726,7 @@ it.layer(NodeServices.layer)("Antigravity installation", (it) => { | ... | @@ -711,7 +726,7 @@ it.layer(NodeServices.layer)("Antigravity installation", (it) => { |
| 711 | source: "override", | 726 | source: "override", |
| 712 | managedVersionDirectory: null, | 727 | managedVersionDirectory: null, |
| 713 | }); | 728 | }); |
| 714 | expect(yield* installation.resolve("agy_acp_server.par")).toMatchObject({ | 729 | expect(yield* installation.resolve(executableName)).toMatchObject({ |
| 715 | source: "override", | 730 | source: "override", |
| 716 | }); | 731 | }); |
| 717 | yield* fs.remove(externalHarness); | 732 | yield* fs.remove(externalHarness); |
| ... | @@ -741,7 +756,7 @@ it.layer(NodeServices.layer)("Antigravity installation", (it) => { | ... | @@ -741,7 +756,7 @@ it.layer(NodeServices.layer)("Antigravity installation", (it) => { |
| 741 | executablePath: externalExecutable, | 756 | executablePath: externalExecutable, |
| 742 | }); | 757 | }); |
| 743 | expect( | 758 | expect( |
| 744 | yield* isolated.installation.resolve("agy_acp_server.par", { PATH: externalDirectory }), | 759 | yield* isolated.installation.resolve(executableName, { PATH: externalDirectory }), |
| 745 | ).toMatchObject({ source: "override", executablePath: externalExecutable }); | 760 | ).toMatchObject({ source: "override", executablePath: externalExecutable }); |
| 746 | }), | 761 | }), |
| 747 | ); | 762 | ); |
| ... | @@ -774,20 +789,12 @@ it.layer(NodeServices.layer)("Antigravity installation", (it) => { | ... | @@ -774,20 +789,12 @@ it.layer(NodeServices.layer)("Antigravity installation", (it) => { |
| 774 | yield* fs.remove(previous.harnessPath); | 789 | yield* fs.remove(previous.harnessPath); |
| 775 | const externalDirectory = path.join(baseDir, "external"); | 790 | const externalDirectory = path.join(baseDir, "external"); |
| 776 | yield* fs.makeDirectory(externalDirectory); | 791 | yield* fs.makeDirectory(externalDirectory); |
| 777 | yield* fs.writeFileString( | 792 | yield* fs.writeFileString(path.join(externalDirectory, executableName), "external server", { |
| 778 | path.join(externalDirectory, "agy_acp_server.par"), | 793 | mode: 0o755, |
| 779 | "external server", | 794 | }); |
| 780 | { | 795 | yield* fs.writeFileString(path.join(externalDirectory, harnessName), "external harness", { |
| 781 | mode: 0o755, | 796 | mode: 0o755, |
| 782 | }, | 797 | }); |
| 783 | ); | | |
| 784 | yield* fs.writeFileString( | | |
| 785 | path.join(externalDirectory, "localharness_external"), | | |
| 786 | "external harness", | | |
| 787 | { | | |
| 788 | mode: 0o755, | | |
| 789 | }, | | |
| 790 | ); | | |
| 791 | const restarted = yield* makeHarness({ baseDir, path: externalDirectory }); | 798 | const restarted = yield* makeHarness({ baseDir, path: externalDirectory }); |
| 792 | expect(yield* restarted.installation.state).toMatchObject({ | 799 | expect(yield* restarted.installation.state).toMatchObject({ |
| 793 | phase: "failed", | 800 | phase: "failed", |
| ... | @@ -824,8 +831,8 @@ it.layer(NodeServices.layer)("Antigravity installation", (it) => { | ... | @@ -824,8 +831,8 @@ it.layer(NodeServices.layer)("Antigravity installation", (it) => { |
| 824 | const profileDirectory = path.join(baseDir, "providers", "antigravity", "profile"); | 831 | const profileDirectory = path.join(baseDir, "providers", "antigravity", "profile"); |
| 825 | yield* fs.makeDirectory(externalDirectory); | 832 | yield* fs.makeDirectory(externalDirectory); |
| 826 | yield* fs.makeDirectory(profileDirectory, { recursive: true }); | 833 | yield* fs.makeDirectory(profileDirectory, { recursive: true }); |
| 827 | const externalExecutable = path.join(externalDirectory, "agy_acp_server.par"); | 834 | const externalExecutable = path.join(externalDirectory, executableName); |
| 828 | const externalHarness = path.join(externalDirectory, "localharness_external"); | 835 | const externalHarness = path.join(externalDirectory, harnessName); |
| 829 | const profilePath = path.join(profileDirectory, "preferences.json"); | 836 | const profilePath = path.join(profileDirectory, "preferences.json"); |
| 830 | yield* fs.writeFileString(externalExecutable, "external server", { mode: 0o755 }); | 837 | yield* fs.writeFileString(externalExecutable, "external server", { mode: 0o755 }); |
| 831 | yield* fs.writeFileString(externalHarness, "external harness", { mode: 0o755 }); | 838 | yield* fs.writeFileString(externalHarness, "external harness", { mode: 0o755 }); |