Remove workspace-root configuration and use client run directories
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"git.a-wan.net/alan/pipelines/internal/protocol"
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
"github.com/charmbracelet/x/ansi"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
@@ -45,6 +46,21 @@ func TestCLIPickerAndMultilinePrompt(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestDashboardRunUsesInvocationDirectory(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
m := New(ctx, "")
|
||||
m.detail = &protocol.PipelineDetail{PipelineSummary: protocol.PipelineSummary{ID: 1, Name: "test", Version: 1}}
|
||||
updated, _ := m.beginRun()
|
||||
m = updated.(Model)
|
||||
cwd, err := os.Getwd()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if m.runWorkspace != cwd {
|
||||
t.Fatal("dashboard did not use invocation directory", m.runWorkspace, cwd)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCLISuppliedArgumentsStillRequireConfirmation(t *testing.T) {
|
||||
m := NewRun(context.Background(), "", RunOptions{Pipeline: "test", Prompt: "task", Workspace: "/repos/a"})
|
||||
m.detail = &protocol.PipelineDetail{PipelineSummary: protocol.PipelineSummary{ID: 1, Name: "test", Version: 1}}
|
||||
|
||||
Reference in New Issue
Block a user