diff --git a/desktop/internal/core/project_generators_test.go b/desktop/internal/core/project_generators_test.go index 679c289e0..25f26ed6f 100644 --- a/desktop/internal/core/project_generators_test.go +++ b/desktop/internal/core/project_generators_test.go @@ -13,11 +13,16 @@ import ( "github.com/1lck/Lithe-IDEA/desktop/internal/contractfixture" ) -var projectGeneratorFixtures = contractfixture.Path("fixtures/project-generators") +// projectGeneratorFixtures is a function, not a package variable: this test binary also runs as +// the AskPass helper, whose environment Core cuts to what ssh needs, and package initialisation +// runs before TestMain can see that mode. +func projectGeneratorFixtures() string { + return contractfixture.Path("fixtures/project-generators") +} func projectFixture(t *testing.T, name string) json.RawMessage { t.Helper() - data, err := os.ReadFile(filepath.Join(projectGeneratorFixtures, name)) + data, err := os.ReadFile(filepath.Join(projectGeneratorFixtures(), name)) if err != nil { t.Fatal(err) } @@ -99,7 +104,7 @@ func TestProjectGeneratorWrappersMatchTheSharedGoldenCases(t *testing.T) { t.Fatalf("form = %+v\nwant %+v", form, *expected.Form) } case "generationPlan": - plan, err := client.ProjectGenerationPlanOf(projectContext(t), manifest, test.GeneratorID, projectGeneratorFixtures, input) + plan, err := client.ProjectGenerationPlanOf(projectContext(t), manifest, test.GeneratorID, projectGeneratorFixtures(), input) if expected.Status == "rejected" { var rejection *ProjectRejection if !errors.As(err, &rejection) || rejection.Code != expected.Error.Code { diff --git a/desktop/internal/workbench/new_project_test.go b/desktop/internal/workbench/new_project_test.go index 8e3f96884..1d1e8d5e9 100644 --- a/desktop/internal/workbench/new_project_test.go +++ b/desktop/internal/workbench/new_project_test.go @@ -72,7 +72,12 @@ func (h *harness) openNewProjectSheet() { h.await("the generator catalog", func() bool { return h.app.newProject.catalogLoaded }) } -var generatorFixtures = contractfixture.Path("fixtures/project-generators") +// generatorFixtures is a function, not a package variable: this test binary also runs as the +// AskPass helper, whose environment Core cuts to what ssh needs, and package initialisation runs +// before TestMain can see that mode. +func generatorFixtures() string { + return contractfixture.Path("fixtures/project-generators") +} const ( generatorToolPlugin = "dev.lithe.test.generator-tools" @@ -165,11 +170,11 @@ func TestNewProjectOnlyDiscoversToolsRequestedByTheForm(t *testing.T) { func fixtureGeneratorPlugin(t *testing.T) pluginservice.GeneratorPlugin { t.Helper() - data, err := os.ReadFile(filepath.Join(generatorFixtures, "project-generator.plugin.json")) + data, err := os.ReadFile(filepath.Join(generatorFixtures(), "project-generator.plugin.json")) if err != nil { t.Fatal(err) } - path, err := filepath.Abs(generatorFixtures) + path, err := filepath.Abs(generatorFixtures()) if err != nil { t.Fatal(err) } @@ -1024,11 +1029,11 @@ func TestNewProjectGeneratorKeepsTheCreatedDirectoryWhenGitFails(t *testing.T) { } func TestNewProjectToolFieldListsInstallationsAndPinsTheChoice(t *testing.T) { - data, err := os.ReadFile(filepath.Join(generatorFixtures, "project-generator-tool-field.plugin.json")) + data, err := os.ReadFile(filepath.Join(generatorFixtures(), "project-generator-tool-field.plugin.json")) if err != nil { t.Fatal(err) } - path, _ := filepath.Abs(generatorFixtures) + path, _ := filepath.Abs(generatorFixtures()) plugin := pluginservice.GeneratorPlugin{PluginID: "dev.lithe.fixture.project-generator-tool-field", Version: "1.0.0", Path: path, Enabled: true, Manifest: data} parent := t.TempDir() h := newGeneratorHarness(t, &testKernel{Client: core.NewClient()}, plugin) diff --git a/scripts/desktop/build-desktop-core.sh b/scripts/desktop/build-desktop-core.sh index 735e09a72..d97a4bc44 100755 --- a/scripts/desktop/build-desktop-core.sh +++ b/scripts/desktop/build-desktop-core.sh @@ -306,11 +306,18 @@ PINNED_CORE_REPOSITORY="https://github.com/Lithe-IDEA/Lithe-core-rust.git" # code for a workspace the user has not trusted (#2208). # Lithe-core-rust main at 94408ca: #142 returns Git's authentication failure without asking to # retry once a credential question was cancelled or expired unanswered (#2231). -# Lithe-core-rust feat/2231-saved-connections at d1a5b82 (#145, on main 7c1cd55): #143 shares the -# Unix socket peer check, #144 adds and removes single trusted locations (#2207), #145 keeps the -# saved SSH connections (remote.connections, remote.editConnections) and refuses a field of a -# connection by name. Replace with the main commit once #145 is merged. -PINNED_CORE_REVISION="d1a5b829ef508f3b1a692a7d05df66004fe87b08" +# Lithe-core-rust main at 7c1cd55: #143 shares one peer_uid implementation across the remote +# crate; #144 lets toolchains.editCatalog add and remove trustedLocations, refusing filesystem +# roots and lists over 256 entries (#2207). +# Lithe-core-rust main at 7901a86: #145 keeps the saved SSH connections (remote.connections, +# remote.editConnections) and refuses a field of a connection by name; #146 checks the server +# build against the SHA-256 the client names before uploading it (S17); #148 gives OpenSSH only +# allow-listed environment variables (S26); #149 reports resource labels, running time and the +# terminal command in server.state (#2231). +# Lithe-core-rust main at 66a1476: #147 starts, stops and lists port forwards +# (remote.startForward, remote.stopForward, remote.forwards) and names the process of each +# listening port (S28/S29, #2231). +PINNED_CORE_REVISION="66a147629cc9f82fc551a52682b522230e6a8340" PROFILE="debug" CHECKOUT_ONLY="no" while [[ $# -gt 0 ]]; do