Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actually call the correct numbers #433

Merged
merged 1 commit into from
Jun 21, 2024
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
32 changes: 32 additions & 0 deletions cmd/plan_mapper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,35 @@ func TestMappedItemDiffsFromPlan(t *testing.T) {
t.Errorf("Expected secret query scope to be 'dogfood.default', got '%v'", secret.GetMappingQuery().GetScope())
}
}

func TestPlanMappingResultNumFuncs(t *testing.T) {
result := PlanMappingResult{
Results: []PlannedChangeMapResult{
{
Status: MapStatusSuccess,
},
{
Status: MapStatusSuccess,
},
{
Status: MapStatusNotEnoughInfo,
},
{
Status: MapStatusUnsupported,
},
},
}

if result.NumSuccess() != 2 {
t.Errorf("Expected 2 success, got %v", result.NumSuccess())
}

if result.NumNotEnoughInfo() != 1 {
t.Errorf("Expected 1 not enough info, got %v", result.NumNotEnoughInfo())
}

if result.NumUnsupported() != 1 {
t.Errorf("Expected 1 unsupported, got %v", result.NumUnsupported())
}

}
5 changes: 2 additions & 3 deletions cmd/tea_submitplan.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ func (m submitPlanModel) submitPlanCmd() tea.Msg {
m.processing <- submitPlanUpdateMsg{m.resourceExtractionTask.UpdateStatusMsg(taskStatusRunning)}
time.Sleep(time.Second)


m.processing <- submitPlanUpdateMsg{m.resourceExtractionTask.UpdateTitleMsg(
"Extracting 13 changing resources: 4 supported 9 unsupported",
)}
Expand Down Expand Up @@ -491,8 +490,8 @@ func (m submitPlanModel) submitPlanCmd() tea.Msg {
m.processing <- submitPlanUpdateMsg{m.resourceExtractionTask.UpdateTitleMsg(
fmt.Sprintf("Extracting %v changing resources: %v supported %v skipped %v unsupported",
mappingResponse.NumTotal(),
mappingResponse.NumUnsupported(),
mappingResponse.NumUnsupported(),
mappingResponse.NumSuccess(),
mappingResponse.NumNotEnoughInfo(),
mappingResponse.NumUnsupported(),
))}

Expand Down
Loading