Objective
Create comprehensive unit tests for three critical files that currently lack test coverage: pkg/workflow/safe_outputs.go, pkg/workflow/scripts.go, and pkg/cli/compile_command.go.
Context
These files handle core functionality (safe output processing, script generation, and workflow compilation commands) and should have comprehensive test coverage. Part of discussion #3770.
Approach
1. Create pkg/workflow/safe_outputs_test.go
- Test all safe output types: create-issue, create-discussion, add-comment, create-pull-request, etc.
- Test output parsing and validation logic
- Test error handling for malformed output
- Use table-driven tests for different output configurations
2. Create pkg/workflow/scripts_test.go
- Test script embedding and retrieval functions
- Test JavaScript bundling logic
- Test script generation for different engines (copilot, claude, codex)
- Validate generated script syntax and structure
3. Create pkg/cli/compile_command_test.go
- Test workflow compilation command execution
- Test --strict flag behavior
- Test --purge flag functionality
- Test error reporting and validation
- Mock file system operations where appropriate
Files to Create
pkg/workflow/safe_outputs_test.go
pkg/workflow/scripts_test.go
pkg/cli/compile_command_test.go
Acceptance Criteria
AI generated by Plan Command for discussion #3770
Objective
Create comprehensive unit tests for three critical files that currently lack test coverage:
pkg/workflow/safe_outputs.go,pkg/workflow/scripts.go, andpkg/cli/compile_command.go.Context
These files handle core functionality (safe output processing, script generation, and workflow compilation commands) and should have comprehensive test coverage. Part of discussion #3770.
Approach
1. Create
pkg/workflow/safe_outputs_test.go2. Create
pkg/workflow/scripts_test.go3. Create
pkg/cli/compile_command_test.goFiles to Create
pkg/workflow/safe_outputs_test.gopkg/workflow/scripts_test.gopkg/cli/compile_command_test.goAcceptance Criteria
make test-unitRelated to 🎯 Repository Quality Improvement Report - Testing Infrastructure #3770