refactor: extract shared base-args helper in main_test.go subprocess tests #154
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Background
During review of PR #151, sonnet noted that
TestMainSubprocess_InvalidDocMapPathandTestMainSubprocess_InvalidDocMapFile(and other subprocess tests) pass the same required flags verbatim. If the required-flag set changes, multiple tests need updating.Proposed Change
Extract a
baseSubprocessArgs()helper function (similar tocleanEnv()) that returns the base set of required flags for subprocess tests. Each test function appends its own test-specific flags.This reduces duplication and makes adding/removing required flags a one-line change.
Scope
Mainly
cmd/review-bot/main_test.go. Non-trivial refactor since many test functions are involved.Origin
Deferred from PR #151 fix plan (sonnet NIT finding #2).