During review of PR #151, sonnet noted that TestMainSubprocess_InvalidDocMapPath and TestMainSubprocess_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 to cleanEnv()) 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).
## Background
During review of PR #151, sonnet noted that `TestMainSubprocess_InvalidDocMapPath` and `TestMainSubprocess_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 to `cleanEnv()`) 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).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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).