Finish native completion and retire legacy command machinery
This commit is contained in:
@@ -32,8 +32,7 @@ inputs:
|
||||
t.Cleanup(func() { config.DefaultSessionConfigSearchPaths = origSessionDefaults })
|
||||
|
||||
var out bytes.Buffer
|
||||
err := Plan(context.Background(), []string{
|
||||
"2026-04-04",
|
||||
err := invokeNativeCommand(context.Background(), []string{"session", "plan", "2026-04-04",
|
||||
"--config", pipelinePath,
|
||||
"--campaign-file", campaignPath,
|
||||
"--previous-session-id", "2026-03-28",
|
||||
@@ -54,7 +53,7 @@ func TestPlanFailsWhenSessionIDMismatchesConcreteSession(t *testing.T) {
|
||||
pipelinePath, campaignPath, sessionPath := writeValidConfigFiles(t, workspaceRoot)
|
||||
|
||||
var out bytes.Buffer
|
||||
err := Plan(context.Background(), []string{"2026-04-04", "--config", pipelinePath, "--campaign-file", campaignPath, "--session", sessionPath}, &out)
|
||||
err := invokeNativeCommand(context.Background(), []string{"session", "plan", "2026-04-04", "--config", pipelinePath, "--campaign-file", campaignPath, "--session-file", sessionPath}, &out)
|
||||
if err == nil {
|
||||
t.Fatal("expected error, got nil")
|
||||
}
|
||||
@@ -81,11 +80,9 @@ inputs:
|
||||
}
|
||||
|
||||
var out bytes.Buffer
|
||||
err := Plan(context.Background(), []string{
|
||||
"2026-05-03",
|
||||
err := invokeNativeCommand(context.Background(), []string{"session", "plan", "2026-05-03",
|
||||
"--config", pipelinePath,
|
||||
"--campaign-file", campaignPath,
|
||||
"--session", sessionPath,
|
||||
"--campaign-file", campaignPath, "--session-file", sessionPath,
|
||||
"--previous-session-id", "2026-04-25",
|
||||
}, &out)
|
||||
if err == nil {
|
||||
@@ -101,11 +98,9 @@ func TestPlanRequiresExpectedPreviousSessionID(t *testing.T) {
|
||||
pipelinePath, campaignPath, sessionPath := writeValidConfigFiles(t, workspaceRoot)
|
||||
|
||||
var out bytes.Buffer
|
||||
err := Plan(context.Background(), []string{
|
||||
"2026-05-03",
|
||||
err := invokeNativeCommand(context.Background(), []string{"session", "plan", "2026-05-03",
|
||||
"--config", pipelinePath,
|
||||
"--campaign-file", campaignPath,
|
||||
"--session", sessionPath,
|
||||
"--campaign-file", campaignPath, "--session-file", sessionPath,
|
||||
"--previous-session-id", "2026-04-26",
|
||||
}, &out)
|
||||
if err == nil {
|
||||
@@ -116,16 +111,16 @@ func TestPlanRequiresExpectedPreviousSessionID(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRunStageAcceptsPositionalSessionIDAndParsesStageName(t *testing.T) {
|
||||
func TestRunSingleStageAcceptsPositionalSessionIDAndParsesStageName(t *testing.T) {
|
||||
workspaceRoot := t.TempDir()
|
||||
pipelinePath, campaignPath, sessionPath := writeValidConfigFiles(t, workspaceRoot)
|
||||
|
||||
var out bytes.Buffer
|
||||
err := RunStage(context.Background(), []string{"prepare", "2026-05-03", "--config", pipelinePath, "--campaign-file", campaignPath, "--session", sessionPath}, &out)
|
||||
err := invokeNativeCommand(context.Background(), []string{"run", "--stage", "prepare", "2026-05-03", "--config", pipelinePath, "--campaign-file", campaignPath, "--session-file", sessionPath}, &out)
|
||||
if err != nil {
|
||||
t.Fatalf("RunStage() error = %v", err)
|
||||
t.Fatalf("single-stage run error = %v", err)
|
||||
}
|
||||
if !strings.Contains(out.String(), "stage=prepare") {
|
||||
if report := decodeNativeReport[runReport](t, out.Bytes()); len(report.Stages) != 1 || report.Stages[0] != "prepare" || !report.Complete {
|
||||
t.Fatalf("output = %q, want stage output", out.String())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user