- Replace broken registerMCPService with mcp.Register (fixes nil ServiceRuntime panic) - Remove dead mcp_service.go, update tests to use mcp.Register directly - Add setTestWorkspace() helper to clear workspaceRootOverride between tests - Fix 40+ test files with workspace state poisoning from loadAgentConfig - Fix forge.lthn.ai → dappco.re in findConsumersList test - Fix BranchWorkspaceCount test to use isolated temp dir - Add CLI test standard: 32 tests across 19 subsystems (tests/cli/) - All 9 packages pass, 0 failures Co-Authored-By: Virgil <virgil@lethean.io>
47 lines
1.2 KiB
Go
47 lines
1.2 KiB
Go
// SPDX-License-Identifier: EUPL-1.2
|
|
|
|
package agentic
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestPlanDependencies_PlanCreate_Good_PreservesPhaseDependencies(t *testing.T) {
|
|
dir := t.TempDir()
|
|
setTestWorkspace(t, dir)
|
|
|
|
s := newTestPrep(t)
|
|
_, created, err := s.planCreate(context.Background(), nil, PlanCreateInput{
|
|
Title: "Dependency Plan",
|
|
Objective: "Keep phase dependencies in the stored plan",
|
|
Phases: []Phase{
|
|
{
|
|
Name: "Build",
|
|
Dependencies: []string{"Setup", "Lint"},
|
|
Criteria: []string{"tests pass"},
|
|
},
|
|
},
|
|
})
|
|
require.NoError(t, err)
|
|
|
|
plan, err := readPlan(PlansRoot(), created.ID)
|
|
require.NoError(t, err)
|
|
require.Len(t, plan.Phases, 1)
|
|
assert.Equal(t, []string{"Setup", "Lint"}, plan.Phases[0].Dependencies)
|
|
}
|
|
|
|
func TestPlanDependencies_PhaseDependenciesValue_Bad_MixedTypesReturnsNil(t *testing.T) {
|
|
dependencies := phaseDependenciesValue([]any{"Setup", 7})
|
|
|
|
assert.Nil(t, dependencies)
|
|
}
|
|
|
|
func TestPlanDependencies_PhaseDependenciesValue_Ugly_NilInputReturnsNil(t *testing.T) {
|
|
dependencies := phaseDependenciesValue(nil)
|
|
|
|
assert.Nil(t, dependencies)
|
|
}
|