Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions desktop/internal/core/project_generators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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 {
Expand Down
15 changes: 10 additions & 5 deletions desktop/internal/workbench/new_project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
Expand Down
17 changes: 12 additions & 5 deletions scripts/desktop/build-desktop-core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading