-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Description
The test helper file tests/helpers-open-issue.sh is a 7-line wrapper that only sources tests/helpers-gh-mock.sh without providing any additional functionality. This redundancy adds unnecessary indirection and maintenance overhead.
Related modules:
tests/helpers-gh-mock.sh- Contains the actual gh CLI mock functionstests/helpers-open-issue.sh- Redundant wrapper to be eliminated- 5 e2e tests in
tests/e2e/that source the wrapper
Proposed Solution
Goal
Eliminate redundant test helper file tests/helpers-open-issue.sh which is a thin wrapper that only sources tests/helpers-gh-mock.sh, providing no additional value.
Success criteria:
- All 5 tests in
tests/e2e/that currently sourcehelpers-open-issue.share updated to sourcehelpers-gh-mock.shdirectly - The file
tests/helpers-open-issue.shis deleted - All tests continue to pass with no behavioral changes
- Documentation is updated to reflect the consolidation
Out of scope:
- Modifying the mock functions themselves (
create_gh_stub(),setup_gh_mock_open_issue()) - Changing test behavior or adding new functionality
- Modifying any tests beyond the sourcing statement update
File Changes
| File | Level | Purpose |
|---|---|---|
| tests/README.md | minor | Remove reference to deleted helper file |
| tests/e2e/test-open-issue-with-draft.sh | minor | Update source statement to use helpers-gh-mock.sh directly |
| tests/e2e/test-open-issue-without-draft.sh | minor | Update source statement to use helpers-gh-mock.sh directly |
| tests/e2e/test-open-issue-update-mode.sh | minor | Update source statement to use helpers-gh-mock.sh directly |
| tests/e2e/test-open-issue-update-maintains-format.sh | minor | Update source statement to use helpers-gh-mock.sh directly |
| tests/e2e/test-open-issue-draft-non-plan.sh | minor | Update source statement to use helpers-gh-mock.sh directly |
| tests/helpers-open-issue.sh | delete | Remove redundant wrapper file |
Implementation Steps
Step 1: Update documentation (Estimated: ~5 LOC)
tests/README.md:16- Remove line listinghelpers-open-issue.shfrom Test Infrastructure section
Step 2: Update test files to source helpers-gh-mock.sh directly (Estimated: ~5 LOC)
tests/e2e/test-open-issue-with-draft.sh:4- Changesource "$TESTS_DIR/helpers-open-issue.sh"tosource "$TESTS_DIR/helpers-gh-mock.sh"tests/e2e/test-open-issue-without-draft.sh:4- Same changetests/e2e/test-open-issue-update-mode.sh:4- Same changetests/e2e/test-open-issue-update-maintains-format.sh:4- Same changetests/e2e/test-open-issue-draft-non-plan.sh:4- Same change
Step 3: Delete redundant wrapper file
- Delete
tests/helpers-open-issue.sh(7 lines removed from codebase)
Test Strategy
Validation approach:
- Run all 5 affected e2e tests to verify they still pass
- Run full test suite with
make test-fastto ensure no regressions
Expected outcome:
- All tests pass with identical behavior (0% functional change)
- No new tests needed (this is pure refactoring with no behavior change)
Total estimated complexity: ~15 LOC (Small refactoring)
Recommended approach: Single commit refactoring, no milestone needed
Related PR
TBD - will be updated when PR is created