[test-coverage] Add comprehensive tests for InteractiveWorkflowBuilder.describeTrigger (+81.8% function coverage, +0.0% overall) #3104
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive unit tests for the
describeTrigger()method inpkg/cli/interactive.go, which previously had only 18.2% coverage.Changes Made
Enhanced Test File
pkg/cli/interactive_test.go- Added 11 test cases covering:All defined trigger types:
workflow_dispatch→ "Manual trigger"issues→ "Issue opened or reopened"pull_request→ "Pull request opened or synchronized"push→ "Push to main branch"issue_comment→ "Issue comment created"schedule_daily→ "Daily schedule (9 AM UTC)"schedule_weekly→ "Weekly schedule (Monday 9 AM UTC)"command→ "Command trigger (/bot-name)"custom→ "Custom trigger (TODO: configure)"Edge cases:
Test Coverage Results
Replicating the Test Coverage Measurements
Problems Found
None - this is a pure string formatting function with straightforward switch statement logic.
Actions Taken
make fmtFuture Improvement Areas
Based on current coverage analysis, the following
pkg/cli/interactive.gofunctions still have low or zero coverage:Zero Coverage Functions (0%):
CreateWorkflowInteractively()- Main interactive workflow builderpromptForWorkflowName()- User input promptingpromptForTrigger()- Trigger selectionpromptForEngine()- Engine selectionpromptForTools()- Tools selectionpromptForSafeOutputs()- Safe outputs configurationpromptForNetworkAccess()- Network access configurationpromptForIntent()- Intent descriptiongenerateWorkflow()- Workflow generationcompileWorkflow()- Workflow compilationMedium Coverage (40-100%):
generateTriggerConfig()- 40.0% coveragegenerateNetworkConfig()- 66.7% coveragegenerateToolsConfig()- 80.0% coveragegenerateSafeOutputsConfig()- 85.7% coveragegenerateWorkflowContent()- 100.0% coveragegeneratePermissionsConfig()- 100.0% coverageThe zero-coverage functions are integration-heavy (require user input/prompts) and would need mocking infrastructure. The partially-covered generator functions could benefit from additional edge case testing.
📋 Full Command History
Bash Commands Run
Web Searches Performed
None
Web Pages Fetched
None