Skip to content

fix: Extract shared dummy_tool test helper (#183)#184

Merged
andreasronge merged 1 commit intomainfrom
claude/issue-183-20251210-001220
Dec 10, 2025
Merged

fix: Extract shared dummy_tool test helper (#183)#184
andreasronge merged 1 commit intomainfrom
claude/issue-183-20251210-001220

Conversation

@andreasronge
Copy link
Copy Markdown
Owner

Summary

Extracts the duplicated dummy_tool/2 test helper function from 5 test files into a new shared module at test/support/test_helpers.ex. This eliminates code duplication (99 usages across 5 files) and improves maintainability while following existing patterns in the codebase.

Changes

  • New file: test/support/test_helpers.ex with the shared dummy_tool/2 helper
  • Updated files: All 5 test files now import the helper and remove local definitions:
    • test/ptc_runner/lisp/eval_control_flow_test.exs
    • test/ptc_runner/lisp/eval_data_types_test.exs
    • test/ptc_runner/lisp/eval_errors_test.exs
    • test/ptc_runner/lisp/eval_functions_test.exs
    • test/ptc_runner/lisp/eval_memory_test.exs

Test Plan

  • All 1014 tests pass
  • All quality checks pass (formatting, compilation, credo, pre-commit tests)
  • No functionality changed, only code organization

Fixes #183

🤖 Generated with Claude Code

Move the duplicated dummy_tool/2 helper function from 5 test files into
a new shared module at test/support/test_helpers.ex. This eliminates code
duplication (99 usages across 5 files) and improves maintainability.

Files modified:
- test/support/test_helpers.ex (new)
- test/ptc_runner/lisp/eval_control_flow_test.exs
- test/ptc_runner/lisp/eval_data_types_test.exs
- test/ptc_runner/lisp/eval_errors_test.exs
- test/ptc_runner/lisp/eval_functions_test.exs
- test/ptc_runner/lisp/eval_memory_test.exs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

PR Review: Extract shared dummy_tool test helper

Summary

Clean tech-debt cleanup that extracts a duplicated dummy_tool/2 test helper from 5 test files into a shared module at test/support/test_helpers.ex. This is a straightforward, low-risk refactoring that follows established patterns in the codebase.

What's Good

  • Follows existing patterns: The new module structure matches test/support/lisp_generators.ex - same namespace (PtcRunner.TestSupport), same doc style
  • Proper module structure: Clean @moduledoc and @doc attributes
  • Complete refactor: All 5 files that had dummy_tool/2 were updated consistently
  • No functionality changed: Pure code organization improvement
  • Tests pass: All 1014 tests pass, confirming the refactor is correct
  • Uses import pattern correctly: Each test file imports the helper, making dummy_tool/2 callable without qualification

Issues (Must Fix)

None.

Suggestions (Optional)

None - this PR is appropriately minimal. The scope is exactly right for a DRY cleanup.

Security

No concerns - this is a test-only change with no security implications.

Documentation

No updates needed - this is internal test infrastructure that doesn't affect public API or architecture docs.

Verdict

Approve - Clean, complete, and follows established patterns. Ready to merge.

@github-actions github-actions bot added the auto-triage-pending Auto-triage in progress label Dec 10, 2025
@andreasronge
Copy link
Copy Markdown
Owner Author

Auto-Triage Summary

Review Analysis

The automated PR review found no issues or suggestions requiring action. This is a clean approval for a well-executed tech-debt cleanup.

Review Highlights

  • ✅ Clean DRY refactor extracting duplicated dummy_tool/2 helper
  • ✅ Follows existing patterns (test/support/lisp_generators.ex)
  • ✅ Complete coverage (all 5 files updated consistently)
  • ✅ All 1014 tests passing
  • ✅ No security concerns (test-only change)

Decisions Made

# Issue Decision Reasoning
- No issues found N/A Review approved with no must-fix items or suggestions

Status

  • FIX_NOW items: 0
  • Issues created: 0
  • Items ignored: 0

Next Steps

Adding ready-to-merge label - this PR is approved and ready for auto-merge.

@andreasronge andreasronge added the ready-to-merge PR is ready to be merged label Dec 10, 2025
@github-actions github-actions bot added auto-triage-cycle-1 Auto-triage cycle 1 auto-triage-complete Auto-triage completed and removed auto-triage-pending Auto-triage in progress labels Dec 10, 2025
@andreasronge andreasronge enabled auto-merge (squash) December 10, 2025 00:16
@andreasronge andreasronge merged commit 4890783 into main Dec 10, 2025
4 checks passed
@andreasronge andreasronge deleted the claude/issue-183-20251210-001220 branch December 10, 2025 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-triage-complete Auto-triage completed auto-triage-cycle-1 Auto-triage cycle 1 ready-to-merge PR is ready to be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[From PR #182] Extract shared dummy_tool test helper to reduce duplication

1 participant